With this sort of problem you will get better chance of a response if you reduce your program down to a small reproducable example which illustrates the behavior. Also give your R version and your OS version.
When I try running sample(100,10) repeatedly on R 1.8.1 under Windows 2000 Pro it works fine: > f <- function() { set.seed(1); sample(100,10) } > > a <- f() > for(i in 1:1000) if (!identical(f(),a)) cat("not identical\n") > Note that no output was produced showing the random numbers were always the same. --- Date: Mon, 5 Jan 2004 13:07:08 +0100 From: Eric ESPOSITO <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: [R] runif and sample with reproducibility Hello, I already sent such an email before Christmas, but nobody answered, so here is my problem: I would like to sample a population but the result needs to be reproducible, using 'runif' or 'sample' is the good way to do it but I can't manage to make the results reproducible even with the 'set.seed' function. My aim is that th call to 'sample(1:100,10)' gives always the same result, how can I do that? Thanks! Eric Esposito ______________________________________________ [EMAIL PROTECTED] 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 ______________________________________________ [EMAIL PROTECTED] 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