library(car)
library(RColorBrewer) # for the color palette

# Let's use the car dataset natively available in R
data <- mtcars

# Make the plot
my_colors <- brewer.pal(nlevels(as.factor(data$cyl)), "Set2")
scatterplotMatrix(~mpg+disp+drat|cyl, data=data , 
      reg.line="" , smoother="", col=my_colors , 
      smoother.args=list(col="grey") , cex=1.5 , 
      pch=c(15,16,17) , 
      main="Scatter plot with Three Cylinder Options"
      )

my_colors <- brewer.pal(nlevels(as.factor(data$cyl)), "Set2")
scatterplotMatrix(~mpg+disp+drat|cyl, data=data , 
      col=my_colors , 
      pch=c(15,16,17) , ellipse=TRUE,
      main="Scatter plot with Three Cylinder Options"
      )

scatterplotMatrix(~prestige + income + education, data=Duncan, id.n=2)