Skip to contents

common name starts with

Usage

common_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")
  # }
common_contains("monkey")
#> Warning: The `check_from` argument of `tbl_sql()` is deprecated as of dbplyr 2.5.0.
#>  The deprecated feature was likely used in the dbplyr package.
#>   Please report the issue at <https://github.com/tidyverse/dbplyr/issues>.
#> # A tibble: 254 × 15
#>    taxonID      scientificName     taxonRank acceptedNameUsageID taxonomicStatus
#>    <chr>        <chr>              <chr>     <chr>               <chr>          
#>  1 ITIS:1025108 Simia lugens       species   ITIS:1025104        synonym        
#>  2 ITIS:1063217 Cercopithecus pol… species   ITIS:1063216        synonym        
#>  3 ITIS:572943  Aotus azarai       species   ITIS:944172         synonym        
#>  4 ITIS:573056  Pygathrix brelichi species   ITIS:944260         synonym        
#>  5 ITIS:944191  Oreonax flavicauda species   ITIS:572961         synonym        
#>  6 ITIS:944303  Mycetes niger      species   ITIS:572939         synonym        
#>  7 ITIS:944308  Cheirogaleus comm… species   ITIS:572951         synonym        
#>  8 ITIS:944314  Nyctipithecus ruf… species   ITIS:572952         synonym        
#>  9 ITIS:944316  Nyctipithecus spi… species   ITIS:572952         synonym        
#> 10 ITIS:944322  Cebus brissonii    species   ITIS:572954         synonym        
#> # ℹ 244 more rows
#> # ℹ 10 more variables: update_date <lgl>, kingdom <chr>, phylum <chr>,
#> #   class <chr>, order <chr>, family <chr>, genus <chr>, specificEpithet <chr>,
#> #   vernacularName <chr>, infraspecificEpithet <lgl>
# }