histWithDist: histWithDist

Description Usage Arguments Details Value Author(s)

Description

Plots histogram with fitted distribution curves

Usage

1
2
histWithDist(x, main = "Histogram with fitted distributions",
  distr = c("nbinom", "pois", "norm", "lnorm"))

Arguments

x

Numeric vector of data values to be plotted to be plotted as a histogram.

main

Title for the plot. Default value is "Histogram with fitted distributions".

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.

Details

This function uses MASS::fitdistr to fit distribution curves to x for the distributions specified, then overlays these on a histogram of x.

Value

Primarily used directly plotting, but also invisibly returns a histWithDist object that can be stored for later plotting if needed.

Author(s)

James Hutchison


hutchisonjtw/JNCCTools documentation built on May 17, 2019, 9:14 p.m.