I'm trying to plot a pca biplot in ggplot with ellipsoids for groups, and I found an example in this thread here.
However, I can't reproduce the result. I ran both versions of Didzis Elfer's solution, but the df_ell
dataframe remains empty. When I run the last command:
ggplot(data = NMDS, aes(MDS1, MDS2)) + geom_point(aes(color = group)) +
geom_path(data=df_ell, aes(x=NMDS1, y=NMDS2,colour=group), size=1, linetype=2)
I get the following error: Error in FUN(X[[i]], ...) : object 'NMDS1' not found
So it seems the function doesn't work. Does it have to do with the most recent version of the vegan package?
All help is appreciated.