network.specificity: Network Specificity

Description Usage Arguments Details Value References Examples

View source: R/specificity_scripts.R

Description

Calculate absolute network specificity not relativized by null models.

Usage

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

Arguments

x

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

abundance.weighted

Logical. TRUE calculates the Paired Difference Index per symbiont. FALSE calculates the Resource Range Index 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 in 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.

Value

A data frame with symbiont identifiers and network 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 Resource Range Index per symbiont
rri <- network.specificity(comm.matrix, abundance.weighted = FALSE, trim = TRUE)

# Calculate Paired Difference Index per symbiont
pdi <- network.specificity(comm.matrix, abundance.weighted = TRUE, trim = TRUE)

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