What does the integer while setting the seed mean?

前端 未结 3 979
清酒与你
清酒与你 2020-12-30 02:11

I want to randomly select n rows from my data set using the sample() function in R. I was getting different outputs each time and hence used

3条回答
  •  暖寄归人
    2020-12-30 02:58

    In the old days, there were books that contained pages and pages of random digits (in a random order, of course).

    I like to think of set.seed(x) as telling the computer to start reading random numbers from page x in a huge book of random numbers. x has nothing to do with the data, but how the algorithm for choosing random numbers should begin.

    This might be a bit facile, but I like the analogy.

提交回复
热议问题