Description Usage Arguments Value Examples
Read a tree to a phylodiv object
1 | pd_read(tree)
|
tree |
a phylogeny represented as a newick string or a 'phylo' object, or a tidytree 'tbl_tree' object |
an object of class 'phylodiv', a named list with slots:
- tree: phylo object - tips: tip labels - nodes: node labels
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
# character
x <- "((Strix_aluco:4.2,Asio_otus:4.2):3.1,Athene_noctua:7.3);"
tree <- ape::read.tree(text = x)
z <- pd_read(tree = tree)
z
# phylo
library(ape)
data(chiroptera)
st <- ape::subtrees(chiroptera)[[393]]
x <- pd_read(tree = st)
x
x$tree
x$tips
x$nodes
# tbl_tree
library(tidytree)
library(ape)
set.seed(2017)
tree <- rtree(4)
x <- as_tibble(tree)
pd_read(x)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.