Monday, April 12, 2010

Random Numbers in R


The key is set.seed( <seed value> );


Then you can use runif(n=<number of values>, <min>, <max>)
to get random reals, or sample(x, size, replace = FALSE, prob = NULL)
to get a random sample from a collection.

No comments:

Post a Comment

Followers