Description Usage Arguments Details Value Author(s)
Plots histogram with fitted distribution curves
1 2 | histWithDist(x, main = "Histogram with fitted distributions",
distr = c("nbinom", "pois", "norm", "lnorm"))
|
x |
Numeric vector of data values to be plotted to be plotted as a histogram. |
main |
Title for the plot. Default value is |
distr |
Character vector of distribution curves to overlay on the histogram. Note that this uses the standard R names for the distributions which differ from those used in emon. Should be one or more of "norm" (normal), "pois" (Poisson), "lnorm" (log normal) and "nbinom" (negative binomial). By default all four are plotted. |
This function uses MASS::fitdistr
to fit distribution curves to x
for the distributions specified, then overlays these on a histogram of x
.
Primarily used directly plotting, but also invisibly returns a histWithDist
object that can be stored for later plotting if needed.
James Hutchison
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.