[R] Help with pair plot

Benjamin Dickgiesser dickgiesser at gmail.com
Sun Feb 18 13:17:48 CET 2007


I'm trying to create a plot using pair.

Currently I'm doing the following

pairs(~mpg + hp + wt , data=cars, labels = c("Miles per
Gallon","Horsepower","Weight"),pch = c(24,25)[unclass(cars$tr + 1)],
bg = c("red", "green3")[unclass(cars$tr + 1)],panel=panel.smooth)

for the attached dataset. However,instead of using panel.smooth I
would rather have two fitted regression lines for each car
transmission type (cars$tr).
Is this possible?

Thank you

More information about the R-help mailing list