as.treedata: as.treedata

View source: R/AllGenerics.R

as.treedataR 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

YuLab-SMU/tidytree documentation built on July 30, 2024, 8:07 p.m.