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] -1.06347 rnorm(n = 1) ## [1] 2.482576 Each time you run the command you will get a different number. »