Learn R Programming

lindia (version 0.10)

gg_reshist: Generate histogram of residuals in ggplot.

Description

Generate histogram of residuals in ggplot.

Usage

gg_reshist(fitted.lm, bins = NULL)

Value

A ggplot object

Arguments

fitted.lm

a fitted linear model (i.e. lm, glm) that contains fitted regression

bins

bin size for histogram

Examples

Run this code
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