[R] how to reproduce the same sampled units?

From: Santanu Pramanik <spramanik_at_survey.umd.edu>
Date: Wed, 02 May 2007 19:25:18 -0400

Hi all,  

Is it possible to generate the same sample number of times in R? In SAS, using the option "seed" it is possible to reproduce exactly the same sample. Is there any such feature in R which I can use?  

For further clarity,  

for (i in 1:2)
samp = sample(1:1000,100,replace = FALSE) print(samp)

For the above simulation, is it possible to generate the same sampled units twice?  

Any suggestion would be gratefully acknowledged. Thanks,

Santanu Pramanik
JPSM,1218J Lefrak Hall
University of Maryland,College Park
Phone no.-301-314-9916    

        [[alternative HTML version deleted]]

R-help_at_stat.math.ethz.ch 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 Wed 02 May 2007 - 23:33:20 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 Thu 03 May 2007 - 02:31:36 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.