View source: R/Taxonomic_utilities.R
LCD_Taxa | R Documentation |
Sums to least common denominator taxa, one taxonomic level at a time
LCD_Taxa(
Data,
Taxalevel,
Groupers = c("Genus_g", "Family_g", "Order_g", "Class_g", "Phylum_g"),
Response = "CPUE"
)
Data |
Zooplankton dataset including columns named the same as the |
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 |
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 ( |
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.
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.
Sam Bashevkin
Zoopsynther
, crosswalk
, zoopComb
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.