as.treedata {tidytree} | R Documentation |
as.treedata
Description
convert a tree object to treedata object
Usage
as.treedata(tree, ...)
## S3 method for class 'tbl_tree'
as.treedata(tree, ...)
Arguments
tree |
tree object |
... |
additional parameters |
Value
treedata object
Examples
library(ape)
set.seed(2017)
tree <- rtree(4)
d <- tibble(label = paste0('t', 1:4),
trait = rnorm(4))
x <- as_tibble(tree)
full_join(x, d, by = 'label') %>% as.treedata
[Package tidytree version 0.4.6 Index]