Requires taxon-tools or docker to be installed.

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

Arguments

taxa

Character vector; taxon names to be parsed by taxon-tools parsenames. 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

docker

Logical; if TRUE, docker will be used to run taxon-tools (so that taxon-tools need not be installed).

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

Details

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

Examples

# Using local taxon-tools installation
if (ts_tt_installed()) {

  ts_parse_names("Foogenus x barspecies var. foosubsp (L.) F. Bar")
  ts_parse_names(
    "Foogenus x barspecies var. foosubsp (L.) F. Bar", tbl_out = TRUE)

  # 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")
  ts_parse_names("Crepidomanes minutum (Blume) K. Iwats.")

}
#> # A tibble: 1 × 9
#>   name              id    genus…¹ genus…² speci…³ speci…⁴ infra…⁵ infra…⁶ author
#>   <chr>             <chr> <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr> 
#> 1 Crepidomanes min… e43e… NA      Crepid… NA      minutum NA      NA      (Blum…
#> # … with abbreviated variable names ¹​genus_hybrid_sign, ²​genus_name,
#> #   ³​species_hybrid_sign, ⁴​specific_epithet, ⁵​infraspecific_rank,
#> #   ⁶​infraspecific_epithet

# Using docker
if (babelwhale::test_docker_installation()) {

ts_parse_names(
  "Foogenus x barspecies var. foosubsp (L.) F. Bar",
  docker = TRUE)

}
#> # A tibble: 1 × 9
#>   name              id    genus…¹ genus…² speci…³ speci…⁴ infra…⁵ infra…⁶ author
#>   <chr>             <chr> <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr> 
#> 1 Foogenus x barsp… 5f20… NA      Foogen… ×       barspe… var.    foosub… (L.) …
#> # … with abbreviated variable names ¹​genus_hybrid_sign, ²​genus_name,
#> #   ³​species_hybrid_sign, ⁴​specific_epithet, ⁵​infraspecific_rank,
#> #   ⁶​infraspecific_epithet