Skip to content

biplot.princomp - changing score labels

7 messages · Brian Ripley, Héctor Villalobos, stephen sefick +1 more

#
Dear R helpers,

When producing a PCA biplot, vectors of environmental variables (as red 
arrows with labels) and scores of the observations (black labels 
(observation names)) are plotted by default. How can I change the 
graphical output? Let's say I would like that the scores are plottet 
only as symbols and not text. The only solution I found was this post in 
the help archive
http://tolstoy.newcastle.edu.au/R/e2/help/06/12/7298.html
suggesting "cheating" like:
 >biplot(test.pca, xlabs=c("0","0","0","0","0","0...
and using letters instead of symbols.
This works somehow, but I am still not able the change e.g. the colour 
or size of only the scores. Whatever I try to do with "col=...", 
"cex=..." and so on changes either all labels in the plot or none. Can 
someone tell me what is the trick to only modify either the 
environmental variables or the scores? Also e.g. the type of the arrow?

Thanks in advance,
Axel
#
OK, the one thing I figured out:
Is should be like:
biplot(test.pca, cex=c(2,1), col=c("red","green")...
to change size, colours etc separately. But I still don't know how 
change lables of observations to symbols properly.

Tipps? Thanks again,
Axel
#
On Tue, 24 Feb 2009, Axel Strau? wrote:

            
That's not part of the design of the function, so just make a copy and 
edit to meet your fancies.

The designer of biplot.princomp.

  
    
#
Prof Brian Ripley schrieb:
The idea behind my question was actually not a "styling one" but to 
provide additional information in the graph. My observations have 
different species richness and I wanted to adopt symbol size to the 
number of species to show the change of species richness along the PCs. 
Anyway, thanks for the comment - and for designing biplot.princomp.

Axel
#
have you thought about extracting the data and using this in ggplot?
On Wed, Feb 25, 2009 at 3:52 AM, Axel Strau? <a.strauss at tu-bs.de> wrote:

  
    
#
Thanks for the hints! They seem to help me.

Axel

H?ctor Villalobos schrieb: