aggregate_taxa: aggregate_taxa

View source: R/aggregate_taxa.R

aggregate_taxaR Documentation

aggregate_taxa

Description

This function aggregates taxa at various taxonomic levels. Preparing data with aggregate_taxa() is necessary for further calculations.

Usage

aggregate_taxa(x, FUN = sum)

Arguments

x

Result of as_biomonitor().

FUN

The function to be applied for aggregating at higher taxonomic levels. Must be sum for both abundances and presence-absence data. Default to sum().

See Also

as_biomonitor

Examples

data(macro_ex)
data_bio <- as_biomonitor(macro_ex)
data_agr <- aggregate_taxa(data_bio)

# example for macrophytes
data(oglio)

oglio_asb <- as_biomonitor(oglio, group = "mf")
oglio_agg <- aggregate_taxa(oglio_asb)
richness(oglio_agg, tax_lev = "Species")
richness(oglio_agg, tax_lev = "Genus")
richness(oglio_agg, tax_lev = "Family")

alexology/biomonitoR documentation built on Oct. 10, 2024, 12:02 a.m.