get_taxa_abundance: get_taxa_abundance

View source: R/get_taxa_abundance.R

get_taxa_abundanceR Documentation

get_taxa_abundance

Description

Calculates the absolute or relative abundance of a taxon or of a set taxa.

Usage

get_taxa_abundance(x, taxa = NULL, rel = FALSE)

Arguments

x

Result of aggregate_taxa().

taxa

A taxon or a vector of taxa.

rel

If TRUE calculates relative abundance. Default to FALSE.

Details

This function does not check for parent-child pairs. For instance if the vector of taxa contains both the genus Baetis and the family Baetidae, the abundance of the genus Baetis will be double counted. Check the function solve_ambiguous() for a solution to this problem.

See Also

aggregate_taxa solve_ambiguous get_taxa_richness

Examples

data(macro_ex)
data_bio <- as_biomonitor(macro_ex)
data_agr <- aggregate_taxa(data_bio)
get_taxa_abundance(data_agr, taxa = "Ephemeroptera")
get_taxa_abundance(data_agr, taxa = c("Setodes", "Orthocladiinae"), rel = TRUE)

alexology/biomonitoR documentation built on April 7, 2024, 10:15 a.m.