get_ott_children: use this instead of rotl::tol_subtree when taxa are not in...

Description Usage Arguments Examples

View source: R/opentree_taxonomy.R

Description

use this instead of rotl::tol_subtree when taxa are not in synthesis tree and you still need to get all species or an induced otol subtree

Usage

1
2
get_ott_children(input = c("Felis", "Homo", "Malvaceae"),
  ott_id = NULL, ott_rank = "species")

Arguments

input

A character vector of names

ott_id

A numeric vector of ott ids obtained with rotl::taxonomy_taxon_info or rolt::tnrs_match_names or datelife::tnrs_match

ott_rank

A character vector with the ranks you wanna get lineage children from.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# try getting an otol tree of a taxon missing from the synthetic tree
# tnrs <- rotl::tnrs_match_names("Mus")
tnrs <- tnrs_match("Canis")
# Mus, Gleicheniales, Polypodiales, etc., are missing in synth tree too
## Not run: 
  rotl::tol_subtree(tnrs$ott_id[1])
  Error: HTTP failure: 400
  [/v3/tree_of_life/subtree] Error: node_id was not found (broken taxon).

## End(Not run)
children <- get_ott_children(ott_id = tnrs$ott_id[1]) # or
children <- get_ott_children("Canis")
rownames(children[[1]])
tree_children <- datelife::get_otol_synthetic_tree(children$Canis)
plot(tree_children, cex = 0.3)
# Other examples:
oo <- get_ott_children(input= "magnoliophyta", ott_rank = "order")
sum(oo$Magnoliophyta$rank == "order") # to know how many orders of flowering plants we have

phylotastic/datelife documentation built on Jan. 22, 2019, 12:29 a.m.