LCD_Taxa: Apply LCD approach for "Taxa" option

View source: R/Taxonomic_utilities.R

LCD_TaxaR Documentation

Apply LCD approach for "Taxa" option

Description

Sums to least common denominator taxa, one taxonomic level at a time

Usage

LCD_Taxa(
  Data,
  Taxalevel,
  Groupers = c("Genus_g", "Family_g", "Order_g", "Class_g", "Phylum_g"),
  Response = "CPUE"
)

Arguments

Data

Zooplankton dataset including columns named the same as the Groupers, a Taxname column, "CPUE", and no other taxonomic identifying columns.

Taxalevel

The value of Groupers on which to apply this function.

Groupers

A character vector of names of additional taxonomic levels to be removed in this step. This vector can include Taxalevel and, if so, it will be removed from the vector within the function so Taxalevel is preserved.

Response

Which response variable(s) would you like for the zooplankton data? Choices are "CPUE" (catch per unit effort) and "BPUE" (carbon biomass per unit effort (\mug/ m3)). Defaults to Response = "CPUE".

Details

This function is designed to work on just one Taxalevel at a time. To apply to multiple Taxalevels, use map or apply functions to apply across taxonomic levels.

Value

A tibble with sums calculated for each unique value in Data$Taxalevel. Sums will be excluded for grouping taxa that only contain 1 unique Taxname.

Author(s)

Sam Bashevkin

See Also

Zoopsynther, crosswalk, zoopComb

Examples

## Not run: 
library(dplyr)
df <- zoopComb%>%
  mutate(dplyr::across(tidyselect::all_of(c("Genus", "Family", "Order", "Class", "Phylum")),
                   list(g=~if_else(.%in%completeTaxaList, ., NA_character_))))%>%
  select(-Phylum, -Class, -Order, -Family, -Genus, -Species, -Taxlifestage)
family_sums <- LCD_Taxa(df, "Family_g")

## End(Not run)


InteragencyEcologicalProgram/zooper documentation built on Feb. 6, 2025, 9:01 a.m.