Learn R Programming

rotl (version 0.5.0)

ott_id.match_names: ott_id and flags for taxonomic names matched by tnrs_match_names

Description

rotl provides a collection of functions that allows users to extract relevant information from an object generated by tnrs_match_names function.

Usage

## S3 method for class 'match_names':
ott_id(tax, row_number, taxon_name, ott_id,
  only_current = TRUE, ...)

flags(tax, ...)

## S3 method for class 'match_names': flags(tax, row_number, taxon_name, ott_id, only_current = TRUE, ...)

Arguments

tax
an object returned by tnrs_match_names
row_number
the row number corresponding to the name for which to list the synonyms
taxon_name
the taxon name corresponding to the name for which to list the synonyms
ott_id
the ott id corresponding to the name for which to list the synonyms
only_current
logical (default TRUE), should the results include data for all matched names, or only the one listed in the object returned by tnrs_match_names?
...
currently ignored

Value

  • A list of the ott ids or flags for the taxonomic names matched with tnrs_match_names, for either one or all the names.

Details

These methods optionally accept one of the arguments row_number, taxon_name or ott_id to retrieve the corresponding information for one of the matches in the object returned by the tnrs_match_names function.

If these arguments are not provided, these methods can return information for the matches currently listed in the object returned by tnrs_match_names (the default) or all the matches (using only_current = FALSE).

Examples

Run this code
rsp <- tnrs_match_names(c("Diadema", "Tyrannosaurus"))
  rsp$ott_id    # ott id for match currently in use
  ott_id(rsp)   # similar as above but elements are named
  ott_id(rsp, only_current=FALSE) # ott id for all possible taxonomic matches

  ## flags() is useful for instance to determine if a taxon is extinct
  flags(rsp, taxon_name="Tyrannosaurus")

Run the code above in your browser using DataLab