[R] set_seed

Prof Brian D Ripley ripley at stats.ox.ac.uk
Tue Mar 7 19:38:29 CET 2000


On Wed, 8 Mar 2000, Nikom Thanomsieng wrote:

> Dear Sir, 
[This is a list: there are a few hundred of us.]

>    I would like to set seed in R before this command
> >B <- 10
> >x <- rnorm(15)
>   for (i in 1:B)
>  {boot.sample <- print(sample(x,replace=T))
> }
> ...
> >
> for reason of stable of data output. How I do ?

If you have R 1.0.0 (or 0.99.0) use the function set.seed, as in
set.seed(54321). If not, we suggest you upgrade (although it can be done by
setting .Random.seed: see ?Random).

I am not sure what you are doing, but as it is often helpful not to
re-invent the wheel you might like to look at package boot.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list