structural.specificity: Absolute Structural Specificity

Description Usage Arguments Details Value References Examples

View source: R/specificity_scripts.R

Description

Calculate absolute structural specificity not relativized by null mdoels.

Usage

1
structural.specificity(x, abundance.weighted = TRUE, trim = TRUE)

Arguments

x

Data frame. Host by symbiont data frame with hosts populating rows and symbionts populating columns.

abundance.weighted

Logical. TRUE calculates Shannon's H per symbiont. FALSE calculates host richness per symbiont.

trim

Logical. TRUE removes symbionts that occupy one host species. FALSE keeps all symbionts.

Details

Hosts are labeled by their species name with a period and number identifier (e.g., hostA.1) to differentiate host samples that are of the same species. This naming scheme is required because host specificity is quantified at the level of host species and not host samples. If this naming scheme does not apply to your experimental design, you should still add identifiers (e.g., .1, .2, .3, etc.) after each host species or sample identifer.

Host specificity for a symbiont is evaluated across the entire host community. More positive values indicate a narrower symbiont niche and higher host specificity. Structural specificity is negated (multipled by -1) to make this consistent across all metrics.

Value

A data frame with symbiont identifiers and absolute structural specificity values.

References

Austen Apigo and Ryoko Oono. 2021. Novel metrics reveal plant abundance, but not plant evolutionary history, shape host specificity in foliar fungal symbionts. In review.

Examples

1
2
3
4
5
# Calculate host species richness per symbiont
host.richness <- structural.specificity(comm.matrix, abundance.weighted = FALSE, trim = TRUE)

# Calculate host species richness per symbiont
shannons.h <- structural.specificity(comm.matrix, abundance.weighted = TRUE, trim = TRUE)

austenapigo/lotus documentation built on Aug. 8, 2021, 10:54 a.m.