# Define metacommunity
pop <- cbind.data.frame(A = c(1, 1), B = c(2, 0), C = c(3, 1))
row.names(pop) <- paste0("sp", 1:2)
pop <- pop / sum(pop)
meta <- metacommunity(pop)
# Calculate subcommunity gamma diversity (takes the power mean)
g <- raw_gamma(meta)
inddiv(g, 0:2)
# Calculate subcommunity beta diversity (takes the relative entropy)
b <- raw_beta(meta)
inddiv(b, 0:2)
# Calculate all measures of individual diversity
inddiv(meta, 0:2)
Run the code above in your browser using DataLab