R Computation

R Tips in Stat 511

March 22, 2010 | Yihui Xie

Here are some (trivial) R tips in the course Stat 511. I’ll update this post till the semester is over. Formatting R Code Reading code is pain, but the well-formatted code might alleviate the pain a little bit. The function tidy.source() in the animation package can help us format ... [Read more...]

Guess the Random Seed

March 12, 2010 | Yihui Xie

tephanie asked in 511 today if we were able to get the random seed which was set by set.seed() but we were only given the random numbers (without knowing the seed). This kind of “hacker” questions sound interesting. One dirty solution should be the brute-force method, e.g: # x: the ... [Read more...]

Counterintuitive Results in Flipping Coins

August 28, 2009 | Yihui Xie

oin-flipping is a rather old topic in probability theory, so most of us think we know very well about it, however, the other day I saw a question about this old topic (in David Smith’s REvolution?) which was beyond me expectation: how many times do we need to flip ... [Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)