trim_taxa: Trim taxa

Description Usage Arguments Details Value Examples

View source: R/trim_taxa.R

Description

Trim excess text from taxa names. Doing this before querying a taxonomic authority improves matching.

Usage

1
trim_taxa(x = NULL, path = NULL)

Arguments

x

(character) A list of taxa names

path

(character) The path to the directory containing taxa_map.csv

Details

Characters trimmed by this function:

Value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Input a list of names

my_taxa <- c("Koeleria_cristata", "Cyperus sp.", "Poa Cf.   ")
my_taxa <- trim_taxa(x = my_taxa)
my_taxa

# Input taxa_map.csv

data <- data.table::fread(system.file("example_data.txt", package = 'taxonomyCleanr'))
my_path <- tempdir()
tm <- create_taxa_map(path = my_path, x = data, col = "Species")
tm <- trim_taxa(path = my_path)
tm

EDIorg/taxonomyCleanr documentation built on Dec. 13, 2021, 7:48 p.m.