Search notes:

R functions: probabilty distributions

Root name

R has a root-name for probability distributions. For example, for the normal distribution, the root name is norm.
R then defines 4 functions for each of these root names by prepending them with d (density), p (distribution function), q (quantile function) and r (generate random deviates) (see prefixes)

Random numbers

Four uniform variates between 3 and 7: runif(4, min=3, max=7)
Two standard normal variates with a mean of 42 and a standard deviation of 9: rnorm(2, mean=42, sd=9).
A binomial variate: rbinom(1, size=6, prob=0.333)
Five poisson variate: rpois(5, lambda=8)
Nine gamma variates: rgamma(9, shape=4, rate=0.333)
s.a: set.seed

See also

SAS function: rand

Links

CRAN Task View: Probability Distributions

Index