The Not In” Operator:

1 2 3 4 5 6 7 8 |
# Define it: '%ni%' <- function(x,y) !('%in%'(x,y)) # Use it: x <- c(1:10); exclude.set <- c(1, 5) y <- x[x %ni% exclude.set] # |

The Not In” Operator:

1 2 3 4 5 6 7 8 |
# Define it: '%ni%' <- function(x,y) !('%in%'(x,y)) # Use it: x <- c(1:10); exclude.set <- c(1, 5) y <- x[x %ni% exclude.set] # |

mclapply() doesn’t work, as it should, on Windows. Therefore, Nathan VanHoudnos has published a package called parallelsugar which replaces mclapply() with a mclapply() that actually works on Windows. You can read more about it here: r-bloggers.com/parallelsugar-an-implementation-of-mclapply-for-windows/ To avoid masking parallelsugar‘s mclapply with parallel‘s mclapply you can use: parallelsugar::mclapply().

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# Naming Conventions by Example # Vector Definition names <- c('Alexandre','Jannik','Radim') weights.lb <- c(188, 195, 194) # Data Frame Definition canucks.forwards <- data.frame(Name = names, WeightLb = weights.lb) # Function Definition convertLbToKg <- function(people) { people$WeightKg <- people$WeightLb * 0.45359237 return(people) } canucks.forwards <- convertLbToKg(canucks.forwards) |

I haven’t been able to find a good agreed-upon naming convention for R therefore, I attempt to create one, for myself and anyone who is interested.

Neil deGrasse Tyson (@neiltyson), the American astrophysicist and cosmologist explains the difference between weather and climate.

Simpson’s paradox, or the Yuleâ€“Simpson effect, is a paradox in probability and statistics, in which a trend that appears in different groups of data but disappears or reverses when these groups are combined.

Check out the cheat sheet Mirko Krivanek has prepared for data visualization with R, particularly, ggplot2.

In a post on Heap data blog, Ravi Parikh (@ravisparikh) explains several ways of misleading the audience with data visualization:

In a podcast on hyper-targeting, Terry O’Reilly (@terryoinfluence) of CBC‘s Under the Influence, talks about many ways advertisers target consumers with “ads that are tailor-made for individuals, featuring the products they want, when they want them, at a price based on their spending ability, at the precise moment they are about to make a choice.”