[R] biplot labels

Julien Barnier jbarnier at lille-metropole-2015.org
Thu May 2 11:07:34 CEST 2002


I am trying to draw the biplot of a PCA, but I would like to use another variable of my initial data frame than my "row.names" to assign 
labels to the points.

A part of my R file follows ; "m" is my initial data frame, which has the variable "code" as row.names, and another variable "name" that I'd 
like to use as labels for the points.

> attach(m)
> t <- subset(m, comm == "59512", select=c(pvviol,pcamb,pvvoit,pvroul,pinc,pdeg,ptot,pvp,pmin))
> library(mva)
> a <- princomp(na.omit(t),cor=TRUE)

I have tried some complicated things like

> biplot(a, cex=0.6, xlabs = subset(m, (comm == "59512") & !(is.na(pvviol)), select = name))

(because I have two points who have missing values), but it doesn't work (error message "length of dimnames[1] not equal to array extent").

Is there a simple way to do that ?
(I hope the explanations of my problem are clear enough)

Thanks a lot in advance.
Julien Barnier
Observatoire des Evolutions Sociales et Urbaines
Agence de développement et d'urbanisme de Lille Métropole
2, place du Concert
59043 Lille Cedex
Tél. :

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list