Sunday, June 5, 2011

R - pairs plot

  • produces a scatterplot matrix
  • with the panel argument you can include smoothers
  • the unclass command changes the factor iris$Species into a vector of integers - so you can use it to define the colors of the points

> data(iris)
> pairs(iris[1:4], main="Edgar Andersons Iris Data", panel=panel.smooth, pch=21, bg=c("red","green","blue")[unclass(iris$Species)],lwd=2,lty=2)


No comments :

Post a Comment