[Rd] Enhancement to termplot()

John Maindonald john.maindonald at anu.edu.au
Sat Jan 24 03:23:47 MET 2004

I'd like to make the following change to termplot():

Add panel=points as an extra parameter.

        if (partial.resid)
             points(xx, pres[, i], cex = cex, pch = pch, col = col.res, 
        if (partial.resid)
             panel(xx, pres[, i], cex = cex, pch = pch, col = col.res, 

Also, I think, add col.smooth, span and iter as named parameters; see 

This allows, e.g., the following

par(mfcol=c(2, 2))
cars.lm <- lm(mpg~disp+hp, data=mtcars)
termplot(cars.lm, partial.resid=T, panel=panel.smooth, 
termplot(cars.lm, partial.resid=T, panel=panel.smooth, col.terms=0,

(col.terms=0 hides the fitted response line or curve.)
These partial regression plots can be highly insightful in a regression

Inclusion of col.smooth, span and iter as named parameters is not
strictly necessary, but it does avert complaints from plot() when they
are passed as unnamed parameters.

(I foreshadowed this when I submitted problem #6327, and offered a fix
that, in default of anything better, I assume will be made or has been 

John Maindonald             email: john.maindonald at anu.edu.au
phone : +61 2 (6125)3473    fax  : +61 2(6125)5549
Centre for Bioinformation Science, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.

More information about the R-devel mailing list