dissect_name: Dissect Scientific Names into their Elements

View source: R/dissect_name.R

dissect_nameR Documentation

Dissect Scientific Names into their Elements

Description

Depending the degree of resolution and specific roles of nomenclature, strings containing taxon usage names (scientific names) are constructed with different parts. A string with names can be consequently split into those elements, meanwhile the number of elements may suggest the taxonomic ranks.

This function is a wrapper of strsplit(), while name element can be re-pasted if indicated in argument repaste.

Usage

dissect_name(x, split = " ", fixed = TRUE, repaste, ...)

Arguments

x

A character vector containing taxon names.

split, fixed, ...

Arguments passed to strsplit().

repaste

An integer vector indicating the elements of the name selected for the output.

Value

A character matrix with as many rows as names in the input vector. If repaste is indicated, then the output will be a character vector.

Author(s)

Miguel Alvarez kamapu78@gmail.com

See Also

strsplit()

Examples

# A list of variety names
sp_list <- subset(x = Easplist, subset = Level == "variety", slot = "relations")
sp_list <- accepted_name(sp_list)[c(1:10), "TaxonName"]

# split name
dissect_name(sp_list)

# re-paste the two first words (species name)
dissect_name(sp_list, repaste = c(1:2))

taxlist documentation built on March 31, 2023, 5:22 p.m.