Re: [R] error message: .Random.seed is not an integer vector but of type 'list'

2009-07-23 Thread Uwe Ligges



Jim Bouldin wrote:

I'm trying to run this simple random sample procedure and keep getting the
error message shown. I don't understand this; I've designated x as a
numeric vector, so what is going on here?  Thanks.


x = as.vector(c(1:12));x

 [1]  1  2  3  4  5  6  7  8  9 10 11 12

mode(x)

[1] numeric

sample(x, 3)
Error in sample(x, 3) : 
  .Random.seed is not an integer vector but of type 'list'



Something has changed/corrupted an object called .Random.seed that is 
required by the Random Number Generator.


Just say
 rm(.Random.seed)
and try again.

Uwe Ligges




Jim Bouldin, PhD
Research Ecologist
Department of Plant Sciences, UC Davis
Davis CA, 95616
530-554-1740

__
R-help@r-project.org 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.


__
R-help@r-project.org 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.


Re: [R] error message: .Random.seed is not an integer vector but of type 'list'

2009-07-23 Thread Jim Bouldin

Thank you.  However, when I tried that, I got this message:

Warning message:
In rm(.Random.seed) : variable .Random.seed was not found
 
 
 Jim Bouldin wrote:
  I'm trying to run this simple random sample procedure and keep getting
 the
  error message shown. I don't understand this; I've designated x as a
  numeric vector, so what is going on here?  Thanks.
  
  x = as.vector(c(1:12));x
   [1]  1  2  3  4  5  6  7  8  9 10 11 12
  mode(x)
  [1] numeric
  sample(x, 3)
  Error in sample(x, 3) : 
.Random.seed is not an integer vector but of type 'list'
 
 
 Something has changed/corrupted an object called .Random.seed that is 
 required by the Random Number Generator.
 
 Just say
   rm(.Random.seed)
 and try again.
 
 Uwe Ligges
 
 
 
  Jim Bouldin, PhD
  Research Ecologist
  Department of Plant Sciences, UC Davis
  Davis CA, 95616
  530-554-1740
  
  __
  R-help@r-project.org 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.


__
R-help@r-project.org 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.


Re: [R] error message: .Random.seed is not an integer vector but of type 'list'

2009-07-23 Thread Uwe Ligges



Jim Bouldin wrote:

Thank you.  However, when I tried that, I got this message:



Warning message:
In rm(.Random.seed) : variable .Random.seed was not found



In that case, have you attached some package that has its own .Random.seed?
Try to find where the current .random.seed comes from R complains about.

Uwe Ligges







Jim Bouldin wrote:

I'm trying to run this simple random sample procedure and keep getting

the

error message shown. I don't understand this; I've designated x as a
numeric vector, so what is going on here?  Thanks.


x = as.vector(c(1:12));x

 [1]  1  2  3  4  5  6  7  8  9 10 11 12

mode(x)

[1] numeric

sample(x, 3)
Error in sample(x, 3) : 
  .Random.seed is not an integer vector but of type 'list'


Something has changed/corrupted an object called .Random.seed that is 
required by the Random Number Generator.


Just say
  rm(.Random.seed)
and try again.

Uwe Ligges




Jim Bouldin, PhD
Research Ecologist
Department of Plant Sciences, UC Davis
Davis CA, 95616
530-554-1740

__
R-help@r-project.org 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.





__
R-help@r-project.org 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.


Re: [R] error message: .Random.seed is not an integer vector but of type 'list'

2009-07-23 Thread Jim Bouldin

 
 
 Jim Bouldin wrote:
  Thank you.  However, when I tried that, I got this message:
  
  Warning message:
  In rm(.Random.seed) : variable .Random.seed was not found
 
 
 In that case, have you attached some package that has its own
 .Random.seed?
 Try to find where the current .random.seed comes from R complains about.
 
 Uwe Ligges

No, there are no attached packages, just the ones that load automatically.
The R commander has some type of RNG but it is not loaded.  Completely stumped.

__
R-help@r-project.org 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.


Re: [R] error message: .Random.seed is not an integer vector but

2009-07-23 Thread Ted Harding
On 23-Jul-09 15:30:05, Jim Bouldin wrote:
 I'm trying to run this simple random sample procedure and keep
 getting the error message shown. I don't understand this; I've
 Thanks.
 
 x = as.vector(c(1:12));x
  [1]  1  2  3  4  5  6  7  8  9 10 11 12
 mode(x)
 [1] numeric
 sample(x, 3)
 Error in sample(x, 3) : 
   .Random.seed is not an integer vector but of type 'list'
 
 Jim Bouldin, PhD

I think this error is not arising from the code you have given above.
I get:

  x=as.vector(c(1:12))
  sample(x,3)
  # [1]  8 12  2

which is fine. '.Random.seed' should be an integer vector to start with.
See '?set.seed'. Therefore it should not be a list. Try entering

  .Random.seed

and see what you get -- when I do it it is a vector of 626 assorted
integers. Also try:

  is.vector(.Random.seed)

and, if that is not TRUE, try

  str(.Random.seed)
  typeof(.Random.seed)

If .Random.seed turns out to be a list, then something has gone
seriously wrong somewhere. It may be that somwehere in your code
there is a command that meddles with .Random.seed (or perhaps it
was saved, in .Rdata, from a previous session where something
went wrong). Or, worst scenario, your R installation is broken ...

And, while I'm at it, your x=as.vector(c(1:12)) is overkill!
Simply

  x - (1:12) ; sample(x,3)

should be enough, or even

  sample((1:12),3)

since (1:12) is a vector (of integers).

Hoping this helps,
Ted.


E-Mail: (Ted Harding) ted.hard...@manchester.ac.uk
Fax-to-email: +44 (0)870 094 0861
Date: 23-Jul-09   Time: 17:13:55
-- XFMail --

__
R-help@r-project.org 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.


Re: [R] error message: .Random.seed is not an integer vector but

2009-07-23 Thread Ted Harding
On 23-Jul-09 16:08:17, Jim Bouldin wrote:
 Jim Bouldin wrote:
  Thank you.  However, when I tried that, I got this message:
 
  Warning message:
  In rm(.Random.seed) : variable .Random.seed was not found
 
 In that case, have you attached some package that has its own
 .Random.seed?
 Try to find where the current .random.seed comes from R complains
 about.
 
 Uwe Ligges
 
 No, there are no attached packages, just the ones that load
 automatically. The R commander has some type of RNG but it is not
loaded.  Completely stumped.

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.hard...@manchester.ac.uk
Fax-to-email: +44 (0)870 094 0861
Date: 23-Jul-09   Time: 17:23:09
-- XFMail --

__
R-help@r-project.org 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.


Re: [R] error message: .Random.seed is not an integer vector but

2009-07-23 Thread Jim Bouldin

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.hard...@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

__
R-help@r-project.org 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.


Re: [R] error message: .Random.seed is not an integer vector but

2009-07-23 Thread Nordlund, Dan (DSHS/RDA)
 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
 Behalf Of Jim Bouldin
 Sent: Thursday, July 23, 2009 9:49 AM
 To: ted.hard...@manchester.ac.uk; ted.hard...@manchester.ac.uk; r-h...@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

__
R-help@r-project.org 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.