Learn R Programming

taxlist (version 0.3.0)

dissect_name: 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, ...)

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.

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.

Author

Miguel Alvarez kamapu78@gmail.com

See Also

Examples

Run this code
# 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))

Run the code above in your browser using DataLab