data(tips)
x <- lm(tip ~ total_bill, data = tips)
lineup_residuals(x, type = 1) # Residuals vs Fitted
lineup_residuals(x, type = 2, method = "pboot") # Normal Q-Q plot
lineup_residuals(x, type = 4) # Residuals vs Leverage
# Style the plot using color settings and ggplot2 functions:
lineup_residuals(x, type = 3,
color_points = "skyblue",
color_trends = "darkorange") +
ggplot2::theme_minimal()
Run the code above in your browser using DataLab