The R Naming System
Every distribution follows the same [prefix][distname] pattern. Learn the four prefixes once and you can use any of R's 30+ distributions instantly.
d
DENSITY
Value of the PDF/PMF at x. How dense or likely is this specific value?
p
PROBABILITY
Returns P(X ≤ q) — cumulative probability up to q. Used for p-values.
q
QUANTILE
Inverse CDF: given probability p, returns x such that P(X≤x)=p. Critical values.
r
RANDOM
Draws n random samples. Use set.seed() first for reproducibility.
| R Functions | Distribution | Key Parameters | Primary Use |
|---|---|---|---|
| dnorm / pnorm / qnorm / rnorm | Normal | mean, sd | z-tests, CI, CLT |
| dlogis / plogis / qlogis / rlogis | Logistic | location, scale | Logistic regression, sigmoid |
| dexp / pexp / qexp / rexp | Exponential | rate λ | Wait times, survival |
| dbinom / pbinom / qbinom / rbinom | Binomial | size n, prob p | Success counts, A/B testing |
| dpois / ppois / qpois / rpois | Poisson | lambda λ | Event counts per interval |
| dt / pt / qt / rt | Student's t | df ν | t-tests, small sample inference |
| dgamma / pgamma / qgamma / rgamma | Gamma | shape α, rate β | Waiting k events, insurance |
| dbeta / pbeta / qbeta / rbeta | Beta | shape1 α, shape2 β | Bayesian priors, proportions |
| dchisq / pchisq / qchisq / rchisq | Chi-squared | df | Goodness-of-fit, variance |
| df / pf / qf / rf | F | df1, df2 | ANOVA, comparing variances |
| dunif / punif / qunif / runif | Uniform | min, max | Simulation, random numbers |
Beyond the Eight
The eight distributions above cover the majority of everyday modelling needs. But the toolbox is larger. Here are three you are likely to encounter next — each closely related to a distribution already covered.
| R Functions | Distribution | Relationship to the Eight | When you need it |
|---|---|---|---|
| dnbinom / pnbinom / qnbinom / rnbinom | Negative Binomial | Extends Poisson by adding a second parameter to allow variance > mean (overdispersion). Reduces to Poisson as the dispersion parameter → ∞. | Count data where variance far exceeds the mean — RNA-seq read counts, insurance claims, social media engagement. |
| dweibull / pweibull / qweibull / rweibull | Weibull | Generalises the Exponential by allowing the failure rate to increase or decrease over time. Exponential is the special case where shape = 1 (constant rate). | Survival analysis and reliability engineering where risk is not constant — machine wear, time-to-failure, clinical trial endpoints. |
| dlnorm / plnorm / qlnorm / rlnorm | Log-Normal | If log(X) is Normal, then X is Log-Normal. Closely related to the Gamma for positive skewed data — both are flexible, but Log-Normal arises from multiplicative rather than additive processes. | Income distributions, species abundance, particle sizes, reaction times — anything arising from many small multiplicative effects. |