Skip to content

controlling the species displayed on a biplot

5 messages · Andrew Halford, Gavin Simpson, Dave Roberts

#
On 05/20/2011 11:54 PM, Andrew Halford wrote:

  
    
1 day later
#
On Sun, 2011-05-22 at 12:15 +1000, Andrew Halford wrote:
If you really want to do this Canoco-esque type of thing then it is
easy, but you need to build the plot up yourself. Here is an exmaple:

## load packages and example data
require(vegan)
require(labdsv)
data(dune)
data(dune.env)

## Indicators of Management type
set.seed(38)
inds <- with(dune.env, indval(dune, Management))

## ordinate
dune.pca <- rda(dune, scale = TRUE)

## exract scores you want to plot presume species and sites
dune.site <- scores(dune.pca, display = "sites", scaling = 3)
dune.spp  <- scores(dune.pca, display = "species", 
                    scaling = 3)[inds$pval <= 0.05, ]

## plot
plot(dune.pca, display = c("sites","species"), type = "n",
     scaling = 3)
points(dune.site)
arrows(0, 0, dune.spp[,1], dune.spp[,2], col = "red", length = 0.05)
lab.xloc <- dune.spp[,1] * 1.2
lab.yloc <- dune.spp[,2] * 1.2
text(lab.xloc, lab.yloc, rownames(dune.spp), col = "red", cex = 0.8)

The placement of the labels is crude and can be improved, but not in a
mailing list post.

HTH

G

  
    
2 days later
#
Thanks Gavin.  That's actually very nice and I suspect just what Andy 
was looking for.

Dave
On 05/23/2011 04:33 AM, Gavin Simpson wrote: