[R-sig-eco] get species within sites ordihull polys
Howard, Tim G (DEC)
tim.howard at dec.ny.gov
Fri Sep 25 20:58:19 CEST 2015
All -
Consider clusters of points in an NMDS with those clusters determined in some way (I'll use hclust below).
Then consider plotting the species on that ordination. I'd like to automatically find which species are 'most associated' with each cluster. Perhaps that translates to finding those species that fall within an ordihull of each group. Before I stumble down into the world of the sp package and spatial overlaps perhaps this is already a part of vegan or another package.
###Example:
library(vegan)
data(dune)
ord <- metaMDS(dune)
# get some groups based on hclust
dis <- vegdist(dune)
clus <- hclust(dis, "average")
plot(clus)
rect.hclust(clus, 3)
grp <- cutree(clus, 3)
#plot the mds with the groups
mdsPlot <- plot(ord, type="n", display = "sites")
points(ord, display = "sites", col="red", pch=19)
ordihull(ord, grp)
#plot the species
points(ord, display = "species", col = "blue", pch=19)
###End example
This isn't the best example because species points don't fall in more than one of the black polygons. But, my question: Can I easily identify which blue points (species) fall within the polygon? Or can I easily identify which species are 'most important' (most abundant?) for defining each of the three groups?
Thanks for any pointers
Tim Howard
More information about the R-sig-ecology
mailing list