review_taxa: Function to clean, combine and remove taxa names

View source: R/review_taxa.R

review_taxaR Documentation

Function to clean, combine and remove taxa names

Description

This function clean taxa names, combines taxa that are similar taxonomically and that may be hard to distinguish in the field, and removes taxa whose identification is too coarse to be useful.

Usage

review_taxa(df, field, review = c("clean", "remove", "combine"))

clean_taxa(df, field)

remove_taxa(df, field)

combine_taxa(df, field)

get_aphia(df, field)

get_classification(df)

Arguments

df

data.frame containing the list of species to be cleaned

field

name of the field containing the list of scientific species names

review

what type(s) of review to perform between c("clean", "remove", "combine", "aphia", "classification"). "clean" removes a certain number of text usually accompanying species names, such as "sp." and "spp.". "combine" modifies the names of species to combine certain species based on a list of species that should be combined (view code), "remove" removes all species that are contained in a list of species that should be removed, "aphia" gets aphiaID of species using the worrms package, and "classification" uses the aphia ID and the taxize package to get taxonomic classification of species.

Value

This function returns the provided data.frame with the names of the species reviewd, cleaned, combined and/or removed. Note that this function was initially built for the species of the estuary and gulf of St. Lawrence and extended to include species of the North West Atlantic. Using this function on any list should be done with care and be thhoroughly reviewed afterwarsd. Also note that the justification for combinations and removals are documented in the code.

Examples

df <- data.frame(
  species = c(
    "Boltenia c.,large", "Boltenia sp. (UNID)",
    "Triglops spp.", "Triglops murrayi",
    "Amphipoda"
  ),
  frequency = c(61, 100, 27, 50, 2)
)
field <- "species"

review_taxa(df, field, "clean")
review_taxa(df, field, c("clean", "remove"))
review_taxa(df, field, c("clean", "combine"))
review_taxa(df, field, c("clean", "aphia"))
(df <- review_taxa(df, field, c("clean", "remove", "combine", "aphia")))
df <- unique(df[, c("species", "aphiaID")])
review_taxa(df, field, c("clean", "remove", "combine", "aphia", "classification"))


Ecosystem-Assessments/eaMethods documentation built on March 24, 2024, 7:23 p.m.