View source: R/opentree_taxonomy_general.R
extract_ott_ids | R Documentation |
Extract numeric OTT ids from a character vector that combines taxon names and OTT ids.
extract_ott_ids(x, na.rm = TRUE)
## Default S3 method:
extract_ott_ids(x, na.rm = TRUE)
x |
A character vector of taxon names, or a phylo object with tree tip labels containing OTT ids. |
na.rm |
A logical value indicating whether |
An object of class numeric containing OTT ids only.
NULL
## Not run: # This is a flag for package development. You are welcome to run the example.
canis <- rotl::tnrs_match_names("canis")
canis_taxonomy <- rotl::taxonomy_subtree(canis$ott_id)
my_ott_ids <- extract_ott_ids(x = canis_taxonomy$tip_label)
# Get the problematic elements from input
canis_taxonomy$tip_label[attr(my_ott_ids, "na.action")]
## End(Not run) # end dontrun
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.