powered by
Produces a histogram for a vector of values and adds a density curve of the distribution.
plotDensityHistogram( x, prob = FALSE, col = "gray", main = "", linecol = "black", lwd = 2, adjust = 1, bw = "nrd0", kernel = "gaussian", ... )
Produces a plot. Returns nothing.
A vector of values.
If FALSE, then counts are displayed in the histogram. If TRUE, then the density is shown.
FALSE
TRUE
The color of the histogram bars.
The title displayed for the plot.
The color of the line in the plot.
The width of the line in the plot.
Passed to density. A lower value makes the density plot smoother.
density
Passed to density.
Other arguments passed to hist.
hist
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
The function relies on the hist function. The density curve relies on the density function.
https://rcompanion.org/handbook/C_04.html
plotNormalHistogram, plotNormalDensity
plotNormalHistogram
plotNormalDensity
### Plot of residuals from a model fit with lm data(Catbus) model = lm(Steps ~ Gender + Teacher, data = Catbus) plotDensityHistogram(residuals(model))
Run the code above in your browser using DataLab