Re: [R] same random numbers in different sessions

2010-10-10 Thread Duncan Murdoch
On 10/10/2010 4:30 AM, Liviu Andronic wrote: Hello On Sun, Oct 10, 2010 at 1:16 AM, jim holtman wrote: You need to set the set.seed yourself. There are some simulation where I do want the same numbers generated and can use the set.seed to set it to a know value. If you want something random

Re: [R] same random numbers in different sessions

2010-10-10 Thread Liviu Andronic
Hello On Sun, Oct 10, 2010 at 1:16 AM, jim holtman wrote: > You need to set the set.seed yourself.  There are some simulation > where I do want the same numbers generated and can use the set.seed to > set it to a know value.  If you want something random each time, then > use the time of day in t

Re: [R] same random numbers in different sessions

2010-10-10 Thread Liviu Andronic
Dear all Thanks for all the pointers. On Sat, Oct 9, 2010 at 11:39 PM, Daniel Nordlund wrote: > Could you be reloading a workspace at start-up that is setting the seed?   > What happens if you start R using the --vanilla option? > It seems that this is the culprit. For some reason, my $HOME sessi

Re: [R] same random numbers in different sessions

2010-10-09 Thread jim holtman
You need to set the set.seed yourself. There are some simulation where I do want the same numbers generated and can use the set.seed to set it to a know value. If you want something random each time, then use the time of day in the call to set.seed. On Sat, Oct 9, 2010 at 5:14 PM, Liviu Andronic

Re: [R] same random numbers in different sessions

2010-10-09 Thread G. Jay Kerns
Dear Liviu, On Sat, Oct 9, 2010 at 5:14 PM, Liviu Andronic wrote: > Dear all > I'm using Xubuntu Lucid and I keep getting the same random numbers > whenever I start a new session of R. For example, I keep getting >> sample(1:1000, 1) > [1] 87 > > or >> rnorm(1:10) >  [1] -1.3618103  0.4241701  1.

Re: [R] same random numbers in different sessions

2010-10-09 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Liviu Andronic > Sent: Saturday, October 09, 2010 2:15 PM > To: r-help@r-project.org Help > Subject: [R] same random numbers in different sessions > &

[R] same random numbers in different sessions

2010-10-09 Thread Liviu Andronic
Dear all I'm using Xubuntu Lucid and I keep getting the same random numbers whenever I start a new session of R. For example, I keep getting > sample(1:1000, 1) [1] 87 or > rnorm(1:10) [1] -1.3618103 0.4241701 1.0720076 0.2208145 -0.5375314 -0.4846588 [7] 0.7576768 0.6527407 -0.6868786 0.8