[R] .Random.seed error

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Aug 12 21:08:16 CEST 2004

On Thu, 12 Aug 2004, Richard Urbano wrote:

> I have this snippet of code from an example in Dr. Harrel's book "Regression
> Modeling Strategies" p 501

That's in a section called `S-PLUS Examples'.
> n<-2000
> .Random.seed <-c(49,39,17,36,23,0,43,51,6,54,50,1)
> age <-50 + 12 * rnorm(n)
> age
> I get the error message:  Error in rnorm(n) : .Random.seed[1] is NOT a valid
> RNG kind (code)
> I have tried this on Windows and Linux  R versions 1.8.1, 1.9.0, and 1.9.1

But you did not try the S-PLUS examples in S-PLUS ....

> If I comment out the .Random.seed line and call set.seed(49),  set.seed(39)
> etc before each call to a random generator function, everyone is HAPPY.

> Does anyone have a suggestion?

Don't confuse S-PLUS and R.

Read the R documentation before posting, as the posting guide asks -- see 
?.Random.seed for the explanation of the format of .Random.seed.

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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list