Parses scientific names into their component parts (genus, species, variety, author, etc).

ts_parse_names(
  taxa,
  tbl_out = getOption("ts_tbl_out", default = FALSE),
  quiet = FALSE
)

Arguments

taxa

Character vector; taxon names to be parsed. Missing values not allowed. Must all be unique.

tbl_out

Logical vector of length 1; should a tibble be returned? If FALSE (default), output will be a data.frame. This argument can be controlled via the option ts_tbl_out; see Examples.

quiet

Logical; if TRUE, suppress warning messages that would normally be issued

Value

A dataframe including the following columns.

  • id: A unique ID number assigned to the input name

  • name: The input name

  • genus_hybrid_sign: Hybrid sign for genus

  • genus_name: Genus name

  • species_hybrid_sign: Hybrid sign for species

  • specific_epithet: Specific epithet (name)

  • infraspecific_rank: Infraspecific rank

  • infraspecific_epithet: Infraspecific epithet (name)

  • author: Name of taxon

Examples

ts_parse_names("Foogenus x barspecies var. foosubsp (L.) F. Bar")
#> # A tibble: 1 × 9
#>   name   id    genus_hybrid_sign genus_name species_hybrid_sign specific_epithet
#>   <chr>  <chr> <chr>             <chr>      <chr>               <chr>           
#> 1 Fooge… 5f20… NA                Foogenus   ×                   barspecies      
#> # ℹ 3 more variables: infraspecific_rank <chr>, infraspecific_epithet <chr>,
#> #   author <chr>
ts_parse_names(
  "Foogenus x barspecies var. foosubsp (L.) F. Bar",
  tbl_out = TRUE
)
#> # A tibble: 1 × 9
#>   name   id    genus_hybrid_sign genus_name species_hybrid_sign specific_epithet
#>   <chr>  <chr> <chr>             <chr>      <chr>               <chr>           
#> 1 Fooge… 5f20… NA                Foogenus   ×                   barspecies      
#> # ℹ 3 more variables: infraspecific_rank <chr>, infraspecific_epithet <chr>,
#> #   author <chr>

# If you always want tibble output without specifying `tbl_out = TRUE`
# every time, set the option:
options(ts_tbl_out = TRUE)
ts_parse_names("Foogenus x barspecies var. foosubsp (L.) F. Bar")
#> # A tibble: 1 × 9
#>   name   id    genus_hybrid_sign genus_name species_hybrid_sign specific_epithet
#>   <chr>  <chr> <chr>             <chr>      <chr>               <chr>           
#> 1 Fooge… 5f20… NA                Foogenus   ×                   barspecies      
#> # ℹ 3 more variables: infraspecific_rank <chr>, infraspecific_epithet <chr>,
#> #   author <chr>
ts_parse_names("Crepidomanes minutum (Blume) K. Iwats.")
#> # A tibble: 1 × 9
#>   name   id    genus_hybrid_sign genus_name species_hybrid_sign specific_epithet
#>   <chr>  <chr> <chr>             <chr>      <chr>               <chr>           
#> 1 Crepi… e43e… NA                Crepidoma… NA                  minutum         
#> # ℹ 3 more variables: infraspecific_rank <chr>, infraspecific_epithet <chr>,
#> #   author <chr>