powered by
Generate histogram of residuals in ggplot.
gg_reshist(fitted.lm, bins = NULL)
A ggplot object
a fitted linear model (i.e. lm, glm) that contains fitted regression
bin size for histogram
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)
Run the code above in your browser using DataLab