Re: [R] set.seed( ) function

From: Petr Savicky <savicky_at_praha1.ff.cuni.cz>
Date: Sun, 24 Apr 2011 12:30:00 +0200

On Sun, Apr 24, 2011 at 10:10:45PM +1200, Penny Bilton wrote:
> Thank you for the help so far. Also, I don't quite understand what the
> set.seed function does. Does it choose a starting point for the random
> number generation?

Yes. The generator produces a periodic sequence, which may be understood as a long cycle. The seed specifies a starting point in this cycle. For the default generator in R, the period is 2^19937-1, which is a Mersenne prime. The period is long enough so that it cannot be exhausted. The function set.seed() allows to choose between approximately 2^32 different starting points.

Petr Savicky.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 24 Apr 2011 - 10:32:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 24 Apr 2011 - 13:20:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive