If you didn't keep the seed, there's no general way to "roll back" the random number generator to a previous state after you've observed a random draw. Going forward, what you may want to do is save the value of .Random.seed
along with the results of your computations. Something like this.
x <- .Random.seed
result <- <your code goes here>
attr(result, "seed") <- x
Then you can reset the PRNG as follows; result2
should be the same as result
.
.Random.seed <- attr(result, "seed")
result2 <- <your code goes here>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…