[R] Pca loading plot lables

Jari Oksanen jarioksa at sun3.oulu.fi
Mon Apr 25 14:00:42 CEST 2005


On Mon, 2005-04-25 at 13:21 +0200, Frédéric Ooms wrote:
> Dear colleagues,
> I a m a beginner with R and I would like to add labels (i.e. the variable names) on a pca loading plot to determine the most relevant variables. Could you please tell me the way to do this kind of stuff.
>     The command I use to draw the pca loading plot is the following :
>     Plot(molprop.pc$loading[,1] ~ molprop.pc$loading[,2])
>     Thanks for your help

Have you tried 'biplot' and found it unsatisfactory for your needs? 

biplot(pr)

Alternatively, you can do it by hand:

plot(pr$loadings, type="n")
text(pr$loadings, rownames(pr$loadings), xpd=TRUE)
abline(h=0); abline(v=0)

If you really want to have Axis 2 as horizontal, then you must replace
all pr$loadings pieces with pr$loadings[,2:1]. 

cheers, jari oksanen
-- 
Jari Oksanen <jarioksa at sun3.oulu.fi>




More information about the R-help mailing list