Useful “R” Snippet

September 2, 2008

I am using R quite a bit at the moment and found a useful snippet of code to generate random “coin tosses”:

x <- sample(c(-1,1), 1000, TRUE)

Leave a Reply