Random Numbers

Random Numbers and Seeds in R

To explore how R generates randome numbers, we will use the rnorm function. This function draws a random number from a normal distribution with a mean = 0 and standard deviation = 1 (though these can be changed with the mean and sd parameters). With n = 1 we will get two random numbers. rnorm(n = 1) ## [1] -0.0370592 rnorm(n = 1) ## [1] 0.1957395 Each time you run the command you will get a different number. »