Managing seed for random number
set.seed(423)
runif(3)
# [1] 0.1089715 0.5973455 0.9726307
# Save the seed
oldseed <- .Random.seed
runif(3)
# [1] 0.7973768 0.2278427 0.5189830
# Restore the seed
.Random.seed <- oldseed
runif(3)
# [1] 0.7973768 0.2278427 0.5189830
Commentaires
Enregistrer un commentaire