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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758201189, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/R/functions/distributions(67): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78