0

I created a Detrended correspondence analysis (DCA) displaying the species using the script below but I'm wanting to add the sites to it. I know I can do this with the simple script of: plot(vare.dca), but not sure how I do this once I have improved the graphics. I'm new to R so apologises if this is a very simple question. Many thanks for any help!

bugs<-read.csv(file= "bugs.csv", row.names='Sites', sep=",", header=TRUE)
env<-read.csv(file= "envir.csv", row.names='Sites', sep=",", header=TRUE) 
library(vegan)

shnam <- make.cepnames(names(bugs)) # abbreviate Latin names
identify(pl, "sp", labels=shnam)
plot(vare.dca, dis="sp", type="n")
sel <- orditorp (vare.dca, dis="species", lab=shnam, pcol = "grey", pch="+")

The data for 'bugs' and 'env' are here: https://gist.github.com/anonymous/dcf0fad859eb879014b2

Gavin Simpson
  • 170,508
  • 25
  • 396
  • 453
  • 1
    Since you are new to R, it would be useful to read: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example If you can `dput(head(bugs))` and `dput(head(env))` that would help those who have no idea what DCA is. – harkmug Aug 01 '13 at 13:29
  • 1
    Debt Collection Agency? – Richie Cotton Aug 01 '13 at 13:56
  • Your code is incomplete; you show a redundant `identify()` call, but crucially not the call to `decorana()` to fit the DCA, a function that most people here will not be aware of. – Gavin Simpson Aug 01 '13 at 14:48

1 Answers1

1

The general way is to use the points() methods, as in

points(vare.dca, display = "sites", col = "red")

or use the text() method if you want the site/sample labels.

orditorp() can also be used, just change the argument to display = "sites", which you could have ascertained by reading ?orditorp.

There are a number of other options, most notably ordipointlabel() which will work harder to stop overlap of various labels.

I've written a number of blog posts on these functions in vegan, which you can consult for more explanation and examples

  1. Decluttering ordination plots in vegan part 1: ordilabel()
  2. Decluttering ordination plots in vegan part 2: orditorp()
  3. Decluttering ordination plots part 3: ordipointlabel()
Gavin Simpson
  • 170,508
  • 25
  • 396
  • 453