Jim Bouldin
2009-Jul-23 16:49 UTC
[R] error message: .Random.seed is not an integer vector but
Thanks much Ted. I actually had just tried what you suggest here before you posted, and resolved the problem. Thanks also for the other tips. I wrote x = as.vector(c(1:12)) because I thought that the mode of x might be the problem, the error message pointing to .Random.seed notwithstanding. On a related note, I did a brief test a couple weeks back where I ran a million random samples of 3 from the vector 1:12 and compared the mean against the known mean. It was off by 1 percent, which indicated that the RNG was biased more than I'd have thought. Comments? Jim> Follow-up to my previous reply (just posted). Having read the other > responses and your reactions, try the following: > > rm(.Random.seed) > set.seed(54321) ## (Or your favourite magic number) [*] > x = as.vector(c(1:12)) ## To reproduce your original code ... ! > sample(x,3) > > [*] When you did rm(.Random.seed) as suggested by Uwe, the variable > .Random.seed was lost, so you have to create it again. > > If, after the above, you still get the problem, then something is > very seriously wrong. > > Ted. > > -------------------------------------------------------------------- > E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk> > Fax-to-email: +44 (0)870 094 0861 > Date: 23-Jul-09 Time: 17:23:09 > ------------------------------ XFMail ------------------------------ >Jim Bouldin, PhD Research Ecologist Department of Plant Sciences, UC Davis Davis CA, 95616 530-554-1740
Nordlund, Dan (DSHS/RDA)
2009-Jul-23 17:14 UTC
[R] error message: .Random.seed is not an integer vector but
> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On > Behalf Of Jim Bouldin > Sent: Thursday, July 23, 2009 9:49 AM > To: Ted.Harding at manchester.ac.uk; ted.harding at manchester.ac.uk; r-help at r- > project.org > Subject: Re: [R] error message: .Random.seed is not an integer vector but > > > Thanks much Ted. I actually had just tried what you suggest here before > you posted, and resolved the problem. Thanks also for the other tips. I > wrote x = as.vector(c(1:12)) because I thought that the mode of x might be > the problem, the error message pointing to .Random.seed notwithstanding. > > On a related note, I did a brief test a couple weeks back where I ran a > million random samples of 3 from the vector 1:12 and compared the mean > against the known mean. It was off by 1 percent, which indicated that the > RNG was biased more than I'd have thought. Comments? > Jim ><<<snip>>> It would be necessary to see the code for your 'brief test' before anyone could meaningfully comment on your results. But your results for a single test could have been a valid "random" result. Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204