R

String tip: complex pattern recognition

Background This post is all about examples and use cases. So…Let’s break a leg. Extract all words except last one using anchors and look arounds nasty_char <- c("I love playing wildly") # remove the last word 'wildly' stringr::str_extract(nasty_char, ".

String tip: vectorized pattern replacement

Example case Suppose you have a bunch of really filthy names, which makes you puke… You can go about fixing those with the help of stringi and stringr Lets say following character vector hosts those filthy names. filthy <- c("Grains %", "Moisture (gm/kg)", "Plant height (cm)", "White spaces", "White space (filth%)") filthy ## [1] "Grains %" "Moisture (gm/kg)" "Plant height (cm)" ## [4] "White spaces" "White space (filth%)" Now to get rid of the filth use string manipulation.

Variance component based parameter estimation of incomplete block designs

Introduction Variance component models are also suited for analysis of incomplete block designs, besides complete block designs. This post aims to demonstrate exactly that. Using a dataset generated from alpha lattice design, I show how the design can be properly modeled and fit using OLS regression having various fixed model components.

Linear mixed model formulation

Introduction Mixed models are quite tricky, in that, while being very powerful extensions of linear models, they are somewhat difficult to conceptualize and otherwise to specify. Mixed models have, in addition to usual fixed effect combination of factors, random effects structure.

Design and analysis of spit plot experiments

Split plot design Design and fieldbook template In a field experiment to test for effects of fungicide on crop, treatment of fungicides may be distinguised into multiple factors – based on chemical constituent, based on formulation, based on the mode of spray, etc.

Layout and visualization of experimental design

Functional approach to creating and combing multiple plots This approach highlights features of gridExtra package that allows combining multiple grob plots using function calls. We explicitly use lapply/split or similar class of purrr functions to really scale the graphics.

Design and analysis of balanced randomized complete block (RCBD) experiment

Introduction Balanced block designs are a class of randomized experimental design that contain equal number of records for a particular level of categorical variable across all blocks. Example 1 Let us generate some data from random process mimicking a single factor process consisting of 3 levels.

Developing flowcharts: an illustration of wheat breeding scheme

Flow diagrams are jam-packed with information. They normally describe a process and actors that are involved in making that happen. With r package diagram, which uses r’s basic plotting capabilities, constructing flowcharts is as easy as drawing any other graphics.

Expressing timestamp data in calendar

Unlike composing a text memos and keeping tracks of those, calendar graphics is a highly effective visual aid to taking notes and summarizing them. Well, we all have used calendar, one way or the other, in our lifetimes.

Grade X result

h1.title { font-size: 50px; color: DarkRed; text-align: center; } h4.author { /* Header 4 - and the author and data headers use this too */ font-size: 18px; font-family: "Times New Roman", Times, serif; color: DarkRed; text-align: center; } h4.