[R] seed problem?

Mika Hamari m|k@@h@m@r|73 @end|ng |rom out|ook@com
Mon Mar 29 18:33:33 CEST 2021


Thank you Bill for your help! In other cases this surely is good thing to check, but in my case it helped earlier today that I removed .RData file according to Jeff�s answer:

�Check if you have a .RData file in your R startup directory. It may contain the seed.�

Now that this file doesn�t exist, random numbers are random.

Mika

L�hett�j�: Bill Dunlap<mailto:williamwdunlap using gmail.com>
L�hetetty: maanantai 29. maaliskuuta 2021 18.56
Vastaanottaja: Mika Hamari<mailto:mika.hamari73 using outlook.com>
Kopio: r-help using r-project.org<mailto:r-help using r-project.org>
Aihe: Re: [R] seed problem?

Does this happen if you start R with the --vanilla flag?  If so it may
be that you have a startup file, .\.Rprofile or %HOME%\.Rprofile that
is calling set.seed(n) for a fixed n.

-Bill

On Mon, Mar 29, 2021 at 12:16 AM Mika Hamari <mika.hamari73 using outlook.com> wrote:
>
> Hi!
>
> I have Windows 10 on PC and different versions of R. I noticed that when I executed simulation with R 4.0.3, it gave exactly the same results next time when I re-opened the program. I didn�t set the seed.
>
> I tested this also with simple �rnorm(10,100,10)�, and the results were every time the same, when I re-opened the program. It seems that it starts with the same seed. R 4.0.0 and 4.0.3 did it, both with 32- and 64-bit versions. But with R Studio the results were every time different, as they were also different with 3.4.3. This explains, why I hadn�t noticed this earlier.
>
> I know the function set.seed(), but I wonder, how in the first place seed can be every time same, if you don�t set it to be. What I read about seeds, this should be very highly improbable occurence.
>
> Thanks to all developers for what they are doing for common good. I love R!
>
> Mika Hamari
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=04%7C01%7C%7C7b2bd48fb686441312fd08d8f2cb2f43%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637526301761924646%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mmOJg62ljt3x2Adp60HLHJqdg%2FtDS6EaW%2B%2ByfcEsimk%3D&reserved=0
> PLEASE do read the posting guide https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.r-project.org%2Fposting-guide.html&data=04%7C01%7C%7C7b2bd48fb686441312fd08d8f2cb2f43%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637526301761924646%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mitEm6LuTLS7fPrSlsVGYvn5gyU2hNCXy70gqqp9DJc%3D&reserved=0
> and provide commented, minimal, self-contained, reproducible code.


	[[alternative HTML version deleted]]



More information about the R-help mailing list