Skip to contents

Get the Open Tree of Life Taxonomic identifier (OTT id) and name of all lineages from one or more input taxa.

Usage

get_ott_lineage(input = NULL, ott_ids = NULL)

Arguments

input

Optional. A character vector of names or a datelifeQuery object.

ott_ids

If not NULL, it takes this argument and ignores input. A numeric vector of ott ids obtained with rotl::taxonomy_taxon_info() or rotl::tnrs_match_names() or tnrs_match().

Value

A list of named numeric vectors of ott ids from input and all the clades it belongs to.

Examples

if (FALSE)  # This is a flag for package development. You are welcome to run the example.

taxa <- c("Homo", "Bacillus anthracis", "Apis", "Salvia")
lin <- get_ott_lineage(taxa)
#> Error in check_ott_input(input, ott_ids): object 'taxa' not found
lin
#> Error in eval(expr, envir, enclos): object 'lin' not found

# Look up an unknown OTT id:
get_ott_lineage(ott_id = 454749)
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |======================================================================| 100%
#> $`Discelium nudum`
#>                    ott_ids   ott_ranks 
#> Discelium          "508293"  "genus"   
#> Disceliaceae       "538343"  "family"  
#> Funariales         "821347"  "order"   
#> Funariidae         "620630"  "subclass"
#> Bryopsida          "821346"  "class"   
#> Bryophytina        "471195"  "no rank" 
#> Bryophyta          "246594"  "phylum"  
#> Embryophyta        "56610"   "no rank" 
#> Streptophyta       "916750"  "phylum"  
#> Chloroplastida     "361838"  "kingdom" 
#> Archaeplastida     "5268475" "kingdom" 
#> Eukaryota          "304358"  "domain"  
#> cellular organisms "93302"   "no rank" 
#> life               "805080"  "no rank" 
#> 

 # end dontrun