Description Usage Arguments Value Examples
View source: R/jaccard_functions.R
Given a list of species names and their functions, and a reference community,
calculate the Jaccard index and return it. This is a low-level function used inside of
higher-level functions (ie, pairwise.jaccard()
) that automate the pairwise comparison
of many communities. Note that if a comparison fails, NA is returned instead. So far this only
seems to happen when comparisons are made between two communities each containing the same,
single species.
1 | jaccard.single(sps, func, commX)
|
sps |
A vector of species' names |
func |
A numerical vector of species' functions |
commX |
A reference community |
This function returns a matrix with a single row, and a column with the Jaccard index.
1 2 3 4 5 6 7 | # Generate mock community data:
set.seed(36)
cm1<-data.frame(sps=LETTERS[seq(1,6)],func=rpois(6,lambda = 2))
cm2<-data.frame(sps=LETTERS[seq(1,6)],func=rpois(6,lambda = 2))
# Compare community 2's species and function lists to community 1
jaccard.single(sps=cm2$sps,func=cm2$func,commX=cm1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.