C7 - DSC551 - R Programming
C7 - DSC551 - R Programming
Science (R Programming)
7. Basic Simulation in R
1 set.seed(1)
2 rnorm(5)
[1] -0.6264538 0.1836433 -0.8356286 1.5952808 0.3295078
1 rnorm(5)
[1] -0.8204684 0.4874291 0.7383247 0.5757814 -0.3053884
Note
In general, you should always set the random number seed when conducting a
simulation so that we will able to reconstruct the exact numbers that we produced
in an analysis.