extract_ott_ids: Get OTT ids from a character vector containing species names...

View source: R/opentree_taxonomy_general.R

extract_ott_idsR Documentation

Get OTT ids from a character vector containing species names and OTT ids.

Description

Get OTT ids from a character vector containing species names and OTT ids.

Usage

extract_ott_ids(x, na.rm = TRUE)

## Default S3 method:
extract_ott_ids(x, na.rm = TRUE)

Arguments

x

A character vector of taxon names, or a phylo object with tip names containing OTT ids.

na.rm

A logical value indicating whether NA values should be stripped from the output.

Value

An object of class numeric containing OTT ids only.

NULL

Examples

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")]

OpenTreeChronograms documentation built on June 22, 2022, 9:08 a.m.