[R] how to initialize random seed properly ?

A.J. Rossini rossini at blindglobe.net
Wed Jun 9 21:48:31 CEST 2004


For reproducibility, you probably want to specify the starting seeds.
I'd worry about using systime.   (for selecting the seeds, you might
consider random draws from a uniform).

best,
-tony

ryszard.czerminski at pharma.novartis.com writes:

> I want to start R processes on multiple processors from single shell 
> script
> and I want all of them to have different random seeds.
> One way of doing this is
>
>         sleep 2 # (with 'sleep 1' I am often getting the same number)
>                ...
>         set.seed(unclass(Sys.time()))
>
> Is there a simpler way without a need to sleep between invoking
> different R processes ?
>
> Ryszard
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
rossini at u.washington.edu            http://www.analytics.washington.edu/ 
Biomedical and Health Informatics   University of Washington
Biostatistics, SCHARP/HVTN          Fred Hutchinson Cancer Research Center
UW (Tu/Th/F): 206-616-7630 FAX=206-543-3461 | Voicemail is unreliable
FHCRC  (M/W): 206-667-7025 FAX=206-667-4812 | use Email

CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}




More information about the R-help mailing list