![]() It should be noted that the previous block of code returns the same pseudorandom numbers than the following: set.seed(1) However, note that if you run rnorm(5) twice, it gives different results: set.seed(1) If you execute the previous code, you will obtain the same output. Run again the previous example where we sampled five random numbers from a Normal distribution, but now specify a seed before: # Specify any integer ![]() If the seed is not specified, R uses the clock of the system to establish one.It is a vector of integers which length depends on the generator. The state of the random number generator is stored in.The purpose of the R set.seed function is to allow you to set a seed and a generator (with the kind argument) in R.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |