gn_parse: gn_parse

Description Usage Arguments Value Examples

View source: R/gn_parse.R

Description

extract names using gnparser

Usage

1
2
3
4
5
6
7
gn_parse(
  x,
  threads = NULL,
  batch_size = NULL,
  ignore_tags = FALSE,
  details = FALSE
)

Arguments

x

(character) vector of scientific names. required

threads

(integer/numeric) number of threads to run. CPU's threads number is the default. default: 4

batch_size

(integer/numeric) maximum number of names in a batch send for processing. default: NULL

ignore_tags

(logical) ignore HTML entities and tags when parsing. default: FALSE

details

(logical) Return more details for a parsed name

Value

a list

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
trys <- function(x) try(x, silent=TRUE)
if (interactive()) {
x <- c("Quadrella steyermarkii (Standl.) Iltis & Cornejo",
  "Parus major Linnaeus, 1788", "Helianthus annuus var. texanus")
trys(gn_parse(x[1]))
trys(gn_parse(x[2]))
trys(gn_parse(x[3]))
trys(gn_parse(x))
# details
w <- trys(gn_parse(x, details = TRUE))
w[[1]]$details # details for one name
lapply(w, "[[", "details") # details for all names
z <- trys(gn_parse(x, details = FALSE)) # compared to regular
z
}

rgnparser documentation built on Jan. 26, 2021, 1:07 a.m.