plotNormalHistogram: Histogram with a normal curve
Description
Produces a histogram for a vector of values and adds a normal
curve with the same mean and standard deviation. The plot
can be used to quickly compare the distribution of data
to a normal distribution.
Usage
plotNormalHistogram(x, prob = FALSE, col = "gray", main = "",
linecol = "blue", lwd = 2, length = 1000, ...)
Arguments
x
A vector of values.
prob
If FALSE, then counts are displayed in the histogram.
If TRUE, then the density is shown.
# NOT RUN {### Plot of residuals from a model fit with lmdata(Catbus)
model = lm(Steps ~ Sex + Teacher,
data = Catbus)
plotNormalHistogram(residuals(model))
# }