0

I have a dataset with 10 communities and 4 environmental variables taken along 60 sites. The plot created CCA on vegan method. I faced the problem with building a convex hull (and ellipse) for mark community points of plot. The search a some R code did not give the result for this version of the code. Source file can be download on the link data.csv.

library(vegan)
df <- read.csv2('data.csv')    
df.env <- df[,2:6] # Vars of environments
df.sp <- df[,7:88] # Vars of species
mod <- cca(df.sp ~ ENV1 + ENV2 + ENV3, df.env)
scl <- 2
colvec <- c("darkorange", "blueviolet", "forestgreen", "green", "deeppink", "gray", "black", "skyblue", "cadetblue", "blue")
plot(mod, type="n", scaling=scl)
with(df.env, points(mod, display="sites", col=colvec[Community],
                            scaling=scl, pch=21, bg=colvec[Community]))
Denis Efimov
  • 115
  • 1
  • 6
  • can you please bring the necessary part of the code here? – Enamul Hassan Jan 09 '16 at 08:30
  • I found a solution for convex hull `ordihull(mod, df.env$Community, lty = 2, col = "gray")` But the contours are obtained in one color, and it is necessary in different colors to appropriate vector colvec in code. – Denis Efimov Jan 10 '16 at 06:26

0 Answers0