0

I'm trying to add ellipses onto my NMDS plot created with Vegan package on R, but although the code goes through without an error, no polygons get drawn onto my graph. After using the summary() function, I found that the area of the polygon is NaN, hence why no polygons get drawn. I'm not sure why I don't have an area - is it something to do with my data?

My data can be found here: https://docs.google.com/spreadsheets/d/1uxWbKAvhdVqnorIMXURvYLrDZuoqejJpUsc9N6wSDxA/edit?usp=sharing

Three transects were done in three types of habitat - Interior forest, edge of the forest and disturbed habitat. Each dragonfly and damselfly seen was counted.

My R code is as follows:

OdonateNMDSdata <- read.csv(file.choose(), header=TRUE)
Odonaterownames <- row.names(OdonateNMDSdata) <- c("Interior", "Edge", "Disturbed")
library(vegan)
OdonateNMDS <- metaMDS(OdonateNMDSdata, k=2)
ordiplot(OdonateNMDS,type="n")
orditorp(OdonateNMDS,display="species",col="red",air=0.01)
orditorp(OdonateNMDS,display="sites",cex=1.25,air=0.01)
Ellipse <- ordiellipse(OdonateNMDS, groups=Odonaterownames, kind = "ehull", draw="polygon", col="blue", cex=0.7, conf=0.95)
summary(Ellipse)

Thanks

  • I have tried to generate `NaN` are from `ordiellipse` but in vain. We really need a reproducible example. One advantage in generating a reproducible example is that while doing so you may actually solve the problem. We do not need the full input data, but probably it will suffice to have NMDS `scores` and the `grouping` vector. When you generate them, you may also check if there is something shady in them, and that may solve your problem. – Jari Oksanen Apr 17 '17 at 12:38

1 Answers1

1

You have three points, and you want to draw three ellipses, one for each point. You need more than one point for each ellipse (and even for two points the enclosing ellipse would be a line connecting the points).

However, it seems that with enclosing ellipse (kind = "ehull") we give NaN as the area of one-point-ellipse, whereas with other kinds we give the area as 0 for one point. I'll change that.

Jari Oksanen
  • 3,287
  • 1
  • 11
  • 15