[Rd] set.seed and /dev/random

Thomas Lumley tlumley at u.washington.edu
Sun May 3 21:46:26 CEST 2009


On Sat, 2 May 2009, Saptarshi Guha wrote:

> Hello,
> In ?set.seed I notice that a seed is created from the system time.
> Thus if two machines were (hypothetically) running for the same time
> and R was started simultaneously on both, the would have the same
> seeds (correct?).

Yes. This could in principle be a problem for clusters, though that level of synchronization is unlikely.

> I assume reading from /dev/random would be different for both of these
> machines, so my question is why not use an integer read from
> /dev/random to create the seed?
>
> Would it be a portability issue?

Yes. Most R users probably don't have /dev/random

    -thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle



More information about the R-devel mailing list