[R] package:AlgDesign and .Random.seed [Broadcast]
Liaw, Andy
andy_liaw at merck.com
Wed Mar 21 15:21:01 CET 2007
From: Michael Kubovy
>
> On Mar 21, 2007, at 4:16 AM, Uwe Ligges wrote:
>
> > Michael Kubovy wrote:
> >> Dear r-helpers,
> >> Could you please help me solve the following problem: When I run
> >> require(AlgDesign)
> >> trt <- LETTERS[1:5]
> >> blk <- 10
> >> trtblk <- 3
> >> BIB <- optBlock(~., withinData = trt, blocksizes =
> rep(trtblk, blk))
> >> In response to the last command, R complains:
> >> Error in optBlock(~., withinData = trt, blocksizes = rep(trtblk,
> >> blk)) :
> >> object ".Random.seed" not found
> >> The documentation of optBlock() in AlgDesign doesn't say that I
> >> needed to set .Random.seed. I thought it was initiated
> automatically
> >> at the beginning of a session. What am I missing?
> >
> >
> > The first line in that function is
> > seed <- .Random.seed
> > but .Random.seed is generated at the first use of R's RNG, hence
> > maybe later. This means the function contains a bug which you
> > should report to the package maintainer, please.
> >
> > Best,
> > Uwe Ligges
>
> Bob Wheeler's response:
>
> > From: Bob Wheeler <rwheeler at echip.com>
> > Date: March 21, 2007 9:19:29 AM EDT
> > To: Michael Kubovy <kubovy at virginia.edu>
> > Subject: Re:
> >
> > Each workspace in R requires you to set a random seed to
> start. You
> > have not done this. It is an R artifact, and has nothing to
> do with
> > AlgDesign.
I do not agree with that assessment (well, it's just my $0.02 anyway).
I don't need a random seed unless I'm doing computations that requires
pseudo-random numbers. There are plenty of times I use R without
needing random seed.
None of the builtin RNGs in R requires explcit seed setting, nor does
any of the ones in the contributed packages that I know of. Thus I
would claim that's a flaw in AlgDesign.
Andy
> > --
> > Bob Wheeler --- http://www.bobwheeler.com/
> > ECHIP, Inc. --- Randomness comes in bunches.
>
> ______________________________________________
> 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.
>
>
>
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments,...{{dropped}}
More information about the R-help
mailing list