traits_get_tree | R Documentation |
A common use case is having a set of traits for a set of species and wanting to get a tree for those species. This involves resolving to the same taxonomy, getting a tree for those species, and then (optionally) pruning the traits and tree to the same set of taxa (this is optional: there are approaches to make up traits or phylogenetic placement in the absence of information).
traits_get_tree(
traits,
tnrs_source = "otol",
tree_source = "otol",
prune = TRUE,
summary_format = "phylo_biggest",
...
)
traits |
Data.frame with species names as rownames |
tnrs_source |
Source for taxonomic name resolution; options are "otol" and "gnr". If set to NULL, assumes names are fine as is |
tree_source |
Source for tree; options are "otol", "phylomatic", "datelife". |
prune |
If TRUE, delete taxa to matching sets only |
summary_format |
What format to return from datelife |
... |
Other options to pass to datelife::datelife_search |
For sources of trees, besides the standard ones (Open Tree of Life, Phylomatic), datelife is also an option. For this, you will have had to install the datelife package (which is only suggested, not required, by this code). It will return the chronogram in the tree store with the most overlap to your set of taxa by default, but you can change options with summary_format; see ?datelife::datelife_search for more info
list with a phy and a traits object, both pruned to the same taxon set, as well as citation information for the sources of the taxonomic resolution and phylogeny (also cite this package and, if you use it, datelife)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.