Description Usage Arguments Value Examples
This function takes two community matrices and extracts 3 coefficients used to calculate conservation value metrics
1 | cv_coef(x, y)
|
x |
A community matrix, with species in columns and samples in rows |
y |
A community matrix, with species in columns and samples in rows |
a list with $shared (the number of shared species), $unique_x (the number of species unique to community x) and $unique_y (the number of species unique to community y)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | data(community_data)
#Select all samples in Evironment 'A'
comm.A<-community_data[which(community_data$environment == "A"),]
# Select only the abundance matrix (columns 1 and 2 contain the 'environment' and 'sample' data)
comm.A <- comm.A[, 3:ncol(comm.A)]
#Select all samples in Evironment 'B'
comm.B<-community_data[which(community_data$environment == "B"),]
# Select only the abundance matrix (columns 1 and 2 contain the 'environment' and 'sample' data)
comm.B <- comm.B[, 3:ncol(comm.B)]
#Calculate coefficients
cv_coef(comm.A, comm.B)
$shared
[1] 29
$unique_x
[1] 0
$unique_y
[1] 1
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.