jaccard.single: Low-level wrapper function for calculating Jaccard index...

Description Usage Arguments Value Examples

View source: R/jaccard_functions.R

Description

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.

Usage

1
jaccard.single(sps, func, commX)

Arguments

sps

A vector of species' names

func

A numerical vector of species' functions

commX

A reference community

Value

This function returns a matrix with a single row, and a column with the Jaccard index.

Examples

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)

ctkremer/priceTools documentation built on May 28, 2019, 7:49 p.m.