Skip to contents

return all taxa in which scientific name contains the text provided

Usage

name_contains(
  name,
  provider = getOption("taxadb_default_provider", "itis"),
  version = latest_version(),
  db = td_connect(),
  ignore_case = TRUE
)

Arguments

name

vector of names (scientific or common, see by) to be matched against.

provider

from which provider should the hierarchy be returned? Default is 'itis', which can also be configured using options(default_taxadb_provider=..."). See [td_create] for a list of recognized providers.

version

Which version of the taxadb provider database should we use? defaults to latest. See tl_import for details.

db

a connection to the taxadb database. See details.

ignore_case

should we ignore case (capitalization) in matching names? Can be significantly slower to run.

Examples

# \donttest{
  # \dontshow{
   ## All examples use a temporary directory
   Sys.setenv(TAXADB_HOME=file.path(tempdir(), "taxadb"))
   options("taxadb_default_provider"="itis_test")
  # }
name_contains("Chera")
#> # A tibble: 6 × 15
#>   taxonID      scientificName      taxonRank acceptedNameUsageID taxonomicStatus
#>   <chr>        <chr>               <chr>     <chr>               <chr>          
#> 1 ITIS:1025105 Cheracebus medemi   species   ITIS:1025105        accepted       
#> 2 ITIS:1025107 Cheracebus lucifer  species   ITIS:1025107        accepted       
#> 3 ITIS:1025110 Cheracebus purinus  species   ITIS:1025110        accepted       
#> 4 ITIS:1025104 Cheracebus lugens   species   ITIS:1025104        accepted       
#> 5 ITIS:1025106 Cheracebus torquat… species   ITIS:1025106        accepted       
#> 6 ITIS:1025111 Cheracebus regulus  species   ITIS:1025111        accepted       
#> # ℹ 10 more variables: update_date <lgl>, kingdom <chr>, phylum <chr>,
#> #   class <chr>, order <chr>, family <chr>, genus <chr>, specificEpithet <chr>,
#> #   vernacularName <chr>, infraspecificEpithet <lgl>
# }