tidytree (version 0.3.3)

as.treedata: as.treedata

Description

convert a tree object to treedata object

Usage

as.treedata(tree, ...)

# S3 method for tbl_tree as.treedata(tree, ...)

Arguments

tree

tree object

...

additional parameters

Value

treedata object

Examples

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab