[R] how to display case names in biplot.prcomp?

Bill.Venables at csiro.au Bill.Venables at csiro.au
Mon May 4 03:35:06 CEST 2009

One way is to give the names you want to use as the rownames of the scores component of the principal component analysis object.  e.g.

pca <- princomp(~.-Species, iris)
rownames(pca$scores) <- paste("C", substring(1001:1150, 2), sep = "")

(May I also suggest you treat the group with a little more courtesy in the way you phrase your questions in future and get your shift key fixed?  It would also be nice to know your real name.)

Bill Venables

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of rat.cage
Sent: Monday, 4 May 2009 10:43 AM
To: r-help at r-project.org
Subject: [R] how to display case names in biplot.prcomp?


im trying hard to display names (given in a seperate variable) instead
of "case numbers" in a pca plot (by biplot of a prcomp output). somebody
could help me with this?


R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list