gg_reshist | R Documentation |
Generate histogram of residuals in ggplot.
gg_reshist(fitted.lm, bins = NULL)
fitted.lm |
a fitted linear model (i.e. lm, glm) that contains fitted regression |
bins |
bin size for histogram |
A ggplot object
library(MASS)
data(Cars93)
cars_lm <- lm(Price~ Passengers + Length + RPM, data = Cars93)
gg_reshist(cars_lm)
# specify number of bins
gg_reshist(cars_lm, bins = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.