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

Posts les plus consultés de ce blog

Standard error from Hessian Matrix... what can be done when problem occurs

stepAIC from package MASS with AICc

Install treemix in ubuntu 20.04