studyTaxonList: Study Taxon List

View source: R/studyTaxonList.R

studyTaxonListR Documentation

Study Taxon List

Description

Takes input phylogenies or vectors of taxon names, checks against taxonomic database, returns vector of cleaned taxonomic names (using taxize::gnr_resolve()) for use in spocc queries, as well as warnings if there are invalid names.

Usage

studyTaxonList(x = NULL, datasources = "GBIF Backbone Taxonomy")

Arguments

x

A phylogeny of class 'phylo' or a vector of class 'character' containing the names of taxa of interest

datasources

A vector of taxonomic data sources implemented in taxize::gnr_resolve. You can see the list using taxize::gnr_datasources().

Value

An object of class occCiteData containing the type of inquiry the user has made –a phylogeny or a vector of names– and a data frame containing input taxa names, the closest match according to taxize::gnr_resolve, and a list of taxonomic data sources that contain the matching name.

Examples

## Inputting a vector of taxon names
studyTaxonList(
  x = c(
    "Buteo buteo",
    "Buteo buteo hartedi",
    "Buteo japonicus"
  ),
  datasources = c("National Center for Biotechnology Information")
)


## Inputting a phylogeny
phylogeny <- ape::read.nexus(
  system.file("extdata/Fish_12Tax_time_calibrated.tre",
    package = "occCite"
  )
)
phylogeny <- ape::extract.clade(phylogeny, 18)
studyTaxonList(
  x = phylogeny,
  datasources = c("GBIF Backbone Taxonomy")
)


hannahlowens/occCite documentation built on Oct. 18, 2024, 1:18 a.m.