[R] "Ordiellipse" in vegan package plot; how to plot sd for individual species
Larsson Emil
emil.larsson at lansstyrelsen.se
Thu Mar 23 13:43:33 CET 2017
Hi R-Help,
I have been looking for an answer to this question for some time without success, so now my hope is that you will distribute it to your email subscribers, or direct me to another forum where this question is not off-topic.
I have a dataset with 224 rows (=sites), ca 20 environmental variables, and presence/absence data for ca 40 species. TI have done an RDA ordination using the vegan package and plotted all species. Now, I want to add standard deviation for each species as circles or ellipses.
How can I do this? I tried using "ordiellipse", guided by this similar request from 2010 answered by Jari Oksanen:
http://r-sig-ecology.471788.n2.nabble.com/Fwd-R-cca-standard-error-species-td4997341.html
I am close but I cannot make it work. I have attached the dataset (V=variables, S= species) and an example sketch of how the final plot should look.
Here is my script so far:
# add environmental and species data separately:
env<-read.delim("clipboard")
attach(env)
str(env)
species<-read.delim("clipboard")
attach(species)?
str(species)
# run RDA command and plot:
mod<-rda(species,env,scale=TRUE)
plot(mod, display = "species")
ordiellipse(mod, groups = rep(1, 224), display="lc", kind ="sd", draw = "polygon",
alpha = 127, label = FALSE, show.groups=TRUE, w = NULL, border = NULL, lty = NULL, lwd=NULL)
Very grateful for any help.
Best regards,
Emil Larsson
More information about the R-help
mailing list