3

I know what set.seed() does and I am aware that each value produces an unique and reproducible random process.

My question is whether it matters what value I use inside of set.seed(). I am asking because sometimes I see weird numbers inside of set.seed(), like set.seed(7*11*13).

This looks like there is some idea behind it. So is this useful for some reason?

AkselA
  • 8,153
  • 2
  • 21
  • 34
  • 4
    No, it doesn't matter and note that it shouldn't matter. Each uses what he/she likes, most use `1`, `123`, `42` ecc.. In your example it looks like a date, note that it's a simple product for R. – RLave Apr 04 '19 at 10:24
  • 1
    Note that the number chosen here is a product of primes, so the code author must think that large numbers with few factors are better – Joseph Young Apr 04 '19 at 10:29
  • This might also be of relevance to you: https://stackoverflow.com/questions/1554958/how-different-do-random-seeds-need-to-be – Cettt Apr 04 '19 at 11:00
  • Also https://stats.stackexchange.com/questions/86285/random-number-set-seedn-in-r and https://stackoverflow.com/questions/14684437/what-does-the-integer-while-setting-the-seed-mean – DJV Apr 04 '19 at 11:03
  • Is the point of seed() so that if you run -1 a few times until you find something you like, you can go into the code panel and get the random seed it came up with, plug that back into the parameters panel, so you can then set it and iterate further on the results you just got? – dbonneville Feb 09 '22 at 23:41

0 Answers0