What is the difference between the functions rnorm
and runif
in R?
2 Answers
rnorm
generates a random value from the normal distribution. runif
generates a random value from the uniform.
rnorm(n, mean = , sd = )
is used to generate n
normal random numbers with arguments mean
and sd
; while runif(n, min = , max = )
is used to generate n
uniform random numbers lie in the interval (min, max)
.
Please check corresponding R help documents for details.
?somefunction
. For example, to check the documentation forrunif
: open up an R session and type?runif
. $\endgroup$