Package 'TNRS'

Title: Taxonomic Name Resolution Service
Description: Provides access to the Taxonomic Name Resolution Service <https://github.com/ojalaquellueva/tnrsapi> through R. The user supplies plant taxonomic names and the package returns resolved taxonomic names along with information on decisions. Optionally, the package can also be used to parse taxonomic names.
Authors: Brian Maitner [aut, cre] , Brad Boyle [aut], Paul Efren [ctb]
Maintainer: Brian Maitner <[email protected]>
License: MIT + file LICENSE
Version: 0.3.6
Built: 2025-02-08 05:08:44 UTC
Source: https://github.com/cran/TNRS

Help Index


Resolve plant taxonomic names

Description

Resolve plant taxonomic names.

Usage

TNRS(
  taxonomic_names,
  sources = c("wcvp", "wfo"),
  classification = "wfo",
  mode = "resolve",
  matches = "best",
  accuracy = NULL,
  skip_internet_check = FALSE,
  ...
)

Arguments

taxonomic_names

Data.frame containing two columns: 1) Row number, 2) Taxonomic names to be resolved (or parsed). Note that these two columns must be in this order. Alternatively, a character vector of names can be supplied.

sources

Character. Taxonomic sources to use. Default is c("wcvp", "wfo"). Options include "wfo", "wcvp", and "cact". Use TNRS_sources() for more information.

classification

Character. Family classification to use. Currently options include "wfo" (the default).

mode

Character. Options are "resolve" and "parse". Default option is "resolve"

matches

Character. Should all matches be returned ("all") or only the best match ("best", the default)?

accuracy

numeric. If specified, only matches with a score greater than or equal to the supplied accuracy level will be returned. If left NULL, the default threshold will be used.

skip_internet_check

Should the check for internet connectivity be skipped? Default is FALSE.

...

Additional parameters passed to internal functions

Value

Dataframe containing TNRS results.

Note

wfo = World Flora Online, wcvp = World Checklist of Vascular Plants, cact = Cactaceae at Caryophyllales.org.

For queries of more than 5000 names, the function will automatically divide the query into batches of 5000 names and then run the batches one after the other. Thus, for very large queries this may take some time. When this is the case, a progress bar will be displayed.

IMPORTANT: Note that parallelization of queries is automatically handled by the API, and so there is no need to further parallelize in R (in fact, doing so may actually slow things down!).

Examples

## Not run: 
# Take a subset of the testfile to speed up runtime
tnrs_testfile <- tnrs_testfile[1:20, ]

results <- TNRS(taxonomic_names = tnrs_testfile)

# Inspect the results
head(results, 10)

## End(Not run)

Resolve a small batch of plant taxonomic names

Description

Resolve a small batch of plant taxonomic names

Usage

TNRS_base(
  taxonomic_names,
  sources = c("wcvp", "wfo"),
  classification = "wfo",
  mode = "resolve",
  matches = "best",
  accuracy = NULL,
  skip_internet_check = FALSE,
  ...
)

Arguments

taxonomic_names

Data.frame containing two columns: 1) Row number, 2) Taxonomic names to be resolved (or parsed). Alternatively, a character vector of names can be supplied.

sources

Character. Taxonomic sources to use. Default is c("wcvp", "wfo"). Options include "wfo", and "wcvp".

classification

Character. Family classification to use. Currently options include "wfo" (the default).

mode

Character. Options are "resolve" and "parse". Default option is "resolve"

matches

Character. Should all matches be returned ("all") or only the best match ("best", the default)?

accuracy

numeric. If specified, only matches with a score greater than or equal to the supplied accuracy level will be returned.

skip_internet_check

Should the check for internet connectivity be skipped? Default is FALSE.

...

Additional parameters passed to internal functions

Value

Dataframe containing TNRS results.

Note

This function is primarily used as an internal function of TNRS and can only handle relatively small batches of names.

usda = United States Department of Agriculture, wfo = World Flora Online, wcvp = World Checklist of Vascular Plants.


Get citation information

Description

Returns information needed to cite the TNRS

Usage

TNRS_citations(skip_internet_check = FALSE, ...)

Arguments

skip_internet_check

Should the check for internet connectivity be skipped? Default is FALSE.

...

Additional parameters passed to internal functions

Value

Dataframe containing bibtex-formatted citation information

Note

This function provides citation information in bibtex format that can be used with reference manager software (e.g. Paperpile, Zotero). Please do remember to cite both the sources and the TNRS, as the TNRS couldn't exist without these sources!

Examples

{
  citation_info <- TNRS_citations()
}

Get TNRS metadata

Description

Returns metadata on TNRS including version and citation information

Usage

TNRS_metadata(bibtex_file = NULL, skip_internet_check = FALSE)

Arguments

bibtex_file

Optional output file for writing bibtex citations.

skip_internet_check

Should the check for internet connectivity be skipped? Default is FALSE.

Value

List containing: (1) bibtex-formatted citation information, (2) information about TNRS data sources, and (3) TNRS version information.

Note

This function provides citation information in bibtex format that can be used with reference manager software (e.g. Paperpile, Zotero). Please remember to cite both the sources and the TNRS, as the TNRS couldn't exist without these sources!

This function is a wrapper that returns the output of the functions TNRS_citations, TNRS_sources, and TNRS_version.

Examples

{
  metadata <- TNRS_metadata()
}

Get information on sources used by the TNRS

Description

Return metadata about the current TNRS sources

Usage

TNRS_sources(skip_internet_check = FALSE, ...)

Arguments

skip_internet_check

Should the check for internet connectivity be skipped? Default is FALSE.

...

Additional parameters passed to internal functions

Value

Dataframe containing information about the sources used in the current TNRS version.

Examples

{
  sources <- TNRS_sources()
}

Get synonyms for a single species

Description

Get synonyms for a single species

Usage

TNRS_synonyms(
  taxonomic_name,
  source = "wcvp",
  skip_internet_check = FALSE,
  ...
)

Arguments

taxonomic_name

Data.frame containing a single row and two columns: 1) Row number, 2) Taxonomic name to get synonyms of. Alternatively, a single name cane be supplied as a character string.

source

Character. A single taxonomic source to use. Default is "wcvp". Options include "wfo", "wcvp", and "cact".

skip_internet_check

Should the check for internet connectivity be skipped? Default is FALSE.

...

Additional parameters passed to internal functions

Value

Dataframe containing synonyms and associated data for a single species.

Note

This function only handles a single source and a single taxonomic name at a time. This is by design.

wfo = World Flora Online, wcvp = World Checklist of Vascular Plants, cact = Cactaceae at Caryophyllales.org

Examples

{

TNRS_synonyms(taxonomic_name = "Sabal palmetto",source =  "wfo")

}

100 scientific names.

Description

A dataset containing scientific names for 100 taxa. Names vary in accuracy and correctness.

Usage

tnrs_testfile

Format

A data frame with 100 rows and 2 variables:

ID

Unique integer identifying each row

taxon

Scientific name, possibly containing errors

...

Source

https://github.com/ojalaquellueva/TNRSapi


Get metadata on current TNRS version

Description

Return metadata about the current TNRS version

Usage

TNRS_version(skip_internet_check = FALSE, ...)

Arguments

skip_internet_check

Should the check for internet connectivity be skipped? Default is FALSE.

...

Additional parameters passed to internal functions

Value

Dataframe containing current TNRS version number, build date, and code version.

Examples

{
  TNRS_version_metadata <- TNRS_version()
}