Description Usage Arguments Details Value References Examples
View source: R/specificity_scripts.R
Calculate beta-specificity not corrected by null models.
1 2 3 4 5 6 | beta.specificity(
x,
index = c("morisita.horn", "horn", "sorensen"),
trim = TRUE,
notify = TRUE
)
|
x |
Data frame of hosts populating rows and symbionts populating columns. |
index |
Character. Method for calculation with the Morisita-Horn, Horn or Sorensen Indices. Sorensen is presence-absence. Horn and Morisita-Horn are abundance weighted. |
trim |
Logical. TRUE removes symbionts that occupy one host species. FALSE keeps all symbionts. |
notify |
Logical. TRUE prints the current iteration of the for loop. |
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.
A data frame with symbiont identifiers and beta-specificity values.
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.
For further detail on the mathematics of beta-specificity, see Jost L, Chao A, Chazdon, L. R. Compositional similarity and β (beta) diversity. In: Magurran AE, McGill BJ, editors. Biological Diversity: Frontiers in Measurement and Assessment. Oxford University Press; 2011. p. 66–84.
1 2 3 4 | # Calculate Morisita-Horn beta-specificity
beta.mor <- beta.specificity(comm.matrix, index = "morisita.horn", trim = TRUE, notify = TRUE)
# Calculate Sorensen beta-specificity
beta.sor <- beta.specificity(comm.matrix, index = "sorensen", trim = TRUE, notify = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.