*norm as an example. From the documentation:
dnorm(x, mean = 0, sd = 1, log = FALSE) pnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) qnorm(p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) rnorm(n, mean = 0, sd = 1)
So if I wanted to know the value of a standard normal distribution at 0, I would do
Which gives us
0.3989423, a reasonable answer.
In the same way
.5. Again, this makes sense, because half of the distribution is to the left of 0.
qnorm will essentially do the opposite of
Finally, there's the
Will generate 10 samples from standard normal.
If you want to change the parameters of a given distribution, simply change them like so
rnorm(10, mean=4, sd= 3)