[R] Random Sample

Erik Iverson eriki at ccbr.umn.edu
Mon Nov 8 22:01:15 CET 2010


?set.seed is what you're looking for

Xiaoxi Gao wrote:
> Hello R users,
> Here is my question about generating random sample. How to set the random seed to recreate the same random numbers?  For example, 10 random numbers is generated from N(0,1), then "runif(10)" is used.What if I want to get the same 10 random numbers when I run runif(10) again? Is it possible?I think .Random.seed should be used here.
> Thanks.
> Xiaoxi  		 	   		  
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org 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.



More information about the R-help mailing list