distributions3, inspired by the eponynmous Julia package, provides a generic function interface to probability distributions.
distributions3 has two goals:
Be extremely well documented and friendly for students in intro stat classes.
The main generics are:
random(): Draw samples from a distribution.
pdf(): Evaluate the probability density (or mass) at a point.
cdf(): Evaluate the cumulative probability up to a point.
quantile(): Determine the quantile for a given probability. Inverse of
You can install
You can install the development version with:
The basic usage of
distributions3 looks like:
quantile() always returns lower tail probabilities. If you aren’t sure what this means, please read the last several paragraphs of
vignette("one-sample-z-confidence-interval") and have a gander at the plot.
distributions3 is not under active development, but is fairly stable and used by several academics for teaching intro stat courses. We are happy to review PRs contributing bug fixes. If you are interested in more actively maintaining and developing
distributions3, please reach out on Github!
Please note that
distributions3 is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
For a comprehensive overview of the many packages providing various distribution related functionality see the CRAN Task View.
distributionalprovides distribution objects as vectorized S3 objects, and is more actively developed that
distr, but uses R6 objects
distris quite similar to
distributions, but uses S4 objects and is less focused on documentation.
fitdistrplusprovides extensive functionality for fitting various distributions but does not treat distributions themselves as objects