Skip to content
Back to formatted view

Raw Message

Message-ID: <7165C467-37F9-4981-B64E-82DFAB50CA2D@gmail.com>
Date: 2013-06-13T21:27:45Z
From: R. Michael Weylandt
Subject: set.seed(x)
In-Reply-To: <51BA0223.5080201@gmail.com>

On Jun 13, 2013, at 18:32, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:

> On 13/06/2013 11:59 AM, Pooya Lalehzari wrote:
>> Hello,
>> If I use set.seed(x) to set a seed for the random number generator, how can I undo that to revert a random output every time I run my code?
> 
> If you remove .Random.seed, then the next time a seed is needed it will be generated from the system clock, so it will appear random.

Also, in recent versions of R (>= 3.0.0 I believe) set.seed(NULL) will do the same. 

MW


> 
> Duncan Murdoch
> 
> ______________________________________________
> R-help at 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.