Questions about set.seed() in R

前端 未结 5 605
栀梦
栀梦 2020-12-15 18:24

I understand what set.seed() does and when I might use it, but I still have many questions about the function. Here are a few:

  1. Is it possible to \
5条回答
  •  感动是毒
    2020-12-15 19:13

    I have the same issue as in question 1. I then figure I can simply reset seed in the loop by:

    set.seed(123)
    x<- rnorm(10,1,1)
    set.seed(null)
    

    This way at the end of each loop the seed just got deleted. It worked for me.

提交回复
热议问题