Search_species: Search species

View source: R/Search_species.R

Search_speciesR Documentation

Search species

Description

Match taxonomic inputs to a given row of ParentChild_gz or its closest ancestor

Usage

Search_species(
  Class = "predictive",
  Order = "predictive",
  Family = "predictive",
  Genus = "predictive",
  Species = "predictive",
  add_ancestors = TRUE,
  Database = FishLife::FishBase_and_RAM,
  ParentChild_gz = Database$ParentChild_gz
)

Arguments

Class

Character input for taxonomic class

Order

Character input for taxonomic class

Family

Character input for taxonomic class

Genus

Character input for taxonomic class

Species

Character input for taxonomic class

add_ancestors

Boolean whether to add ancestors for matching species or not

ParentChild_gz

vector providing index of parent-taxon for every child-taxa

Details

This function attempts to do a smart match to elements of ParentChild_gz. It sweeps from Order to Species and ignores any taxonomic input listed as "predictive" until it finds something else. It then appends "predictive" to any lower taxonomic level that is missing, and checks whether this specification yields a single, unique taxon. If it does, it then returns the row number and potentially any ancestors (higher taxonomic levels)

Value

integer of row numbers of ParentChild_gz matching genus_species


James-Thorson/FishLife documentation built on Feb. 29, 2024, 3:47 a.m.