Re: [R] set.seed( ) function

From: Petr Savicky <>
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. mailing list PLEASE do read the posting guide 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 Please read the posting guide before posting to the list.

list of date sections of archive