Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get only certain plots when plot() returns multiple plots

Tags:

r

When I use plot() with a linear model, I get 4 plots, A normal QQ plot, residuals vs fitted, etc.

How do I get it so I only get the normal QQ plot, or only residual plot. I did it before, I think there is an argument like number= n or something. I need to know so I can save images for all the plots.

like image 236
raj rajaratnam Avatar asked Apr 16 '14 07:04

raj rajaratnam


1 Answers

you should read the documentation of the function plot.lm which is the plot function dedicated to lm. You can select the graphs that you want to display with argument "which". There is 6 graphs that you can choose:

# for the qqplot & residual plot
plot(lm1, which=c(2,1))

hth

like image 55
droopy Avatar answered Oct 17 '22 03:10

droopy