An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130613/767bd411/attachment.pl>
set.seed(x)
4 messages · Pooya Lalehzari, Duncan Murdoch, R. Michael Weylandt +1 more
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. Duncan Murdoch
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.
I asked a similar question earlier in the year, http://r.789695.n4.nabble.com/How-to-stop-set-seed-besides-exiting-out-of-R-td4661717.html I liked this solution from William,
rm(list=".Random.seed", envir=globalenv())
Mike On Thu, Jun 13, 2013 at 5:27 PM, Michael Weylandt
<michael.weylandt at gmail.com> wrote:
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.
______________________________________________ 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.