Skip to content
Prev 356605 / 398500 Next

PCA plot of variable names only

Your description is obscure but the following may get you started. The function prcomp() returns a list in which the matrix x contains the rotated values of your input. Assuming that your "variable names" are the rownames of your input, you can plot them with text().  

Something like (untested):

myPCA <- prcomp(someData)
plot(myPCA$x[,1], myPCA$x[,2], type = "n")
text(myPCA$x[,1], myPCA$x[,2], rownames(someData))

B.
On Nov 30, 2015, at 8:56 AM, debra ragland via R-help <r-help at r-project.org> wrote: