RNG initialization

Ben Bolker bolker@zoo.ufl.edu
Tue, 18 Jan 2000 09:22:57 -0500 (EST)


On Tue, 18 Jan 2000, Prof Brian D Ripley wrote:

> My best guess is that you would like a function like S's set.seed,
> which when called with a single number sets the whole initial seed.
> This is certainly easy to do, and can be done easily in R code.
> Since set.seed seems a suitable name and it would help compatibility,
> would
> 
> set.seed(seed, kind = 0)
> 
> be a suitable interface?  Or would people prefer
> 
> RNGinit(kind, seed)

  set.seed() sounds fine.  On reading this, it occurs to me that I could
probably do something like this that just set the value of .Random.seed in
R code (just copying what RNG_Init() does to set .Random.seed from
time()), without mucking with the C code (although a lot of the details of
RNG settings etc. seem to be in C rather than R code at the moment).

  thanks,
     Ben

-- 
Ben Bolker                                  bolker@zoo.ufl.edu
Zoology Department, University of Florida   http://www.zoo.ufl.edu/bolker
318 Carr Hall/Box 118525                    tel: (352) 392-5697
Gainesville, FL 32611-8525                  fax: (352) 392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._