Empty data frame when computing ellipse data with vegan's ordiellipse for ggplot
<p>I am trying to group data points of an NMDS in ggplot by adding ellipses using the <code>ordiellipse</code> function following the helpful advice from <a href="https://stackoverflow.com/questions/26745267/plotting-ordiellipse-from-vegan-package-with-ggplot2?noredirect=1&amp;lq=1">this post</a>. However, although I don't get any error messages or warnings, calculating the ellipse data produces an empty data frame. 
The dataset is available <a href="https://docs.google.com/spreadsheets/d/1lKEtKz-KCJ0rEt-J1nYEa881bEKTCVOjmW-ep1yKIf4/edit#gid=0" rel="nofollow noreferrer">here</a>, and my code is as following:</p>

<pre><code>library(vegan)
library(ggplot2)

setwd("C:")
veg_matrix &lt;- read.csv("161019_vegetation_matrix.csv",header=T); veg_matrix[2:123] &lt;- lapply(veg_matrix[2:123],as.character); veg_matrix[2:123] &lt;- lapply(veg_matrix[2:123],as.numeric)
rownames(veg_matrix) &lt;- veg_matrix[,1]; veg_matrix &lt;- veg_matrix[,-1] # remove non-numeric rownames (=plot codes) from dataset
speciescomp_NMDS = metaMDS(veg_matrix, k=2, trymax=100, distance="raup", na.rm=T)
plot(speciescomp_NMDS,display="sites",type="n")

# add grouping data
plot_scores &lt;- as.data.frame(scores(speciescomp_NMDS))
plot_scores$plot &lt;- rownames(plot_scores);plot_scores &lt;- cbind(plot_scores,data.frame(matrix(unlist(strsplit(plot_scores$plot,"_")),nrow=24,byrow=T)))[,-3]; colnames(plot_scores)[c(3,4)] &lt;- c("summit","aspect")
plot_scores$group &lt;- ""
plot_scores$group[plot_scores$summit=="BUF"|plot_scores$summit=="SES"] &lt;- "low"
plot_scores$group[plot_scores$summit=="CHA"|plot_scores$summit=="MIN"] &lt;- "intermediate"
plot_scores$group[plot_scores$summit=="CUO"|plot_scores$summit=="GAJ"] &lt;- "high"
plot_scores$group &lt;- transform(plot_scores, as.factor(plot_scores$group))

# compute ellipse data
ord &lt;- ordiellipse(speciescomp_NMDS,plot_scores$group,display = "sites", kind = "sd", conf = .95, label=T)

f_ellipse &lt;- function (cov, center = c(0, 0), scale = 1, npoints = 100) 
{
  theta &lt;- (0:npoints) * 2 * pi/npoints
  Circle &lt;- cbind(cos(theta), sin(theta))
  t(center + scale * t(Circle %*% chol(cov)))
}

df_ell_level &lt;- data.frame()
for(g in levels(plot_scores$group)){
  if(is.null(ord[[g]])) next
  df_ell_level &lt;- rbind(df_ell_level,
                  cbind(as.data.frame(with(plot_scores[plot_scores$group==g,],
                                           f_ellipse(ord[[g]]$cov,ord[[g]]$center,ord[[g]]$scale)))
                        ,level=group))
}
</code></pre>

<p>Any ideas on how to handle this one will be warmly appreciated!</p>