[R] pairs with label

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed May 21 18:17:52 CEST 2003


Saurav Pathak wrote:
> Hi,
> 
> I have not been able to figure out how to label points on a pairs
> (scatter matrix) plot.  That is, I wish all points on a scatter
> matrix to be labeled by a number.  I can do that for a simple plot
> using the text() command:
> 
> plot(data.2d, type="n")
> text(data.2d, labels=the.labels)
> 
> where,
> the.labels <- seq(1,20)
> 
> How may i get the same labels for something like
> pairs(data.4d)
> 
> I cannot use the text() command with pairs(), it seems.
> 
> Thanks,
> Saurav
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Define a panel function for pairs(), see ?pairs for details,
such as:

pairs(data.4d, panel = function(x,y) text(x,y, labels=the.labels)))

Uwe Ligges




More information about the R-help mailing list