[R] how to reproduce the same sampled units?

Kenneth Cabrera krcabrer at une.net.co
Thu May 3 03:15:23 CEST 2007


?set.seed

On Wed, 02 May 2007 18:25:18 -0500, Santanu Pramanik  
<spramanik at survey.umd.edu> wrote:

> 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
> 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.



-- 
Kenneth Roy Cabrera Torres
Cel 315 504 9339



More information about the R-help mailing list