Skip to content

ask help!

4 messages · mei_yuan, Jim Lemon, Brian Ripley +1 more

#
Hi,

In the R console, I have the following:
Error in runif(10) : 
  '.Random.seed' is not an integer vector but of type 'list'
Can someone advise me of the solution of the problem?



Mei-Yuan Chen
Department of Finance
NCHU, aiwan
#
On 07/25/2013 07:44 PM, mei_yuan wrote:
Hi Mei-Yuan,
.Random.seed should be a vector of numeric values. Somehow this has been 
set to an object of type "list":

.Random.seed<-list(.Random.seed)
runif(10)
Error in runif(10) :
   '.Random.seed' is not an integer vector but of type 'list'

I would suggest quitting R and _not_ saving the session, then restarting 
and trying:

runif(10)

again.

Jim
#
No R version was stated, but this is not the behaviour of R-patched so 
you could update.
On 25/07/2013 11:01, Jim Lemon wrote:

  
    
#
On Thu, Jul 25, 2013 at 08:01:50PM +1000, Jim Lemon wrote:
Not saving the session won't help if the previously saved session
(still containing the broken .Random.seed) still lingers around.

So the fix is to start a fresh R session without restoring the
previous workspace (e.g. ``R --no-restore''), and then saving
that. This will lose all previously created stuff, though (which
is something to be aware of in case the workspace contains some
precious unsaved data).

Alternatively, if you run

    rm(.Random.seed)

the ``runif(10)'' call will work again (and create a new .Random.seed
of the right type as a side effect). Then when you quit, do save
the workspace to fix the problem "permanently".

Generally, I recommend disabling automatic saving and restoring of
workspaces, e.g. by aliasing R to ``R --no-save --no-restore'',
and using the save and load functions explicitly where needed;
I've seen (way too) many workspaces that have accumulated phenomenal
amounts of clutter and generating quite a share of "mysterious"
failures and irreproducibilities caused by this auto-save
mechanism.

Best regards, Jan