Skip to content
Prev 303615 / 398506 Next

Plot multiple variables: label points

When you call plot with more than two columns, uses the pairs() function.
That means you have to write a panel function. Here are a couple of 
relatively simple examples:

pairs(variable[,2:4], panel=function(x, y, ...) text(x, y, 
     variable$group))

pairs(variable[,2:4], panel=function(x, y, ...) points(x, y, 
     pch=as.numeric(variable$group)))

The first one plots the group instead of a point and the second
one plots a symbol for each group.

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352