Question

I'm using vegan for a DCA ordination. I want to show my grouped sites, but when I use ordispider the labels of the groups are hiding eachother. How can I adjust their position? is it possible to use orditkplot somehow?

Was it helpful?

Solution

No, it is not possible to orditkplot() with ordispider(), it simply doesn't know how to handle arbitrary plotting functions like this.

You don't indicate why you want to use ordispider() to show your grouped sites in the DCA ordination? You don't need to join them to some centroid or similar just to indicate group membership. Instead you can use plotting symbols to differentiate the groups, e.g.

require("vegan")
data(dune)
data(dune.env)

mod <- decorana(dune)

plot(mod, display = "sites", type = "n")

## colour & shape according to Management
col <- c("red","orange","forestgreen","navy")
pch <- 1:4
## add the points
with(dune.env,
     points(mod, display = "sites", col = col[Management],
            pch = pch[Management]))
## add a legend
legend("topright",
       legend = with(dune.env, levels(Management)),
       col = col, pch = pch, title = "Management",
       bty = "n")

Alternatively, I suppose you could plot without labels and add them later, perhaps using locator() to identify clear regions of the plot in which to place the labels, for example:

plot(mod, display = "sites", type = "p")
with(dune.env, ordispider(mod, groups = Management, col = "red"))
## select 4 locations
coords <- locator(with(dune.env, length(levels(Management))))

## now you have to click on the plot where you want the labels
## automagically finishes after you click the 4th label in this case

## draw labels
text(coords, labels = with(dune.env, levels(Management)))

OTHER TIPS

Have you tried the following from the vegan vignette?

2.1. Cluttered plots
Ordination plots are often congested: there is a large number of sites and species, and it may be impossible to display all clearly. In particular, two or more species may have identical scores and are plotted over each other. Vegan does not have (yet?) automatic tools for clean plotting in these cases, but here some methods you can try:
- Zoom into graph setting axis limits xlim and ylim. You must typically set both, because
vegan will maintain equal aspect ratio of axes.
- Use points and add labell only some points with identify command.
- Use select argument in ordination text and points functions to only show the specied
items.
- Use ordilabel function that uses opaque background to the text: some text labels will
be covered, but the uppermost are readable.
- Use automatic orditorp function that uses text only if this can be done without overwriting
previous labels, but points in other cases.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top