Description Usage Arguments Value
Create a data frame from a phylo object where each row corresponds to a node in the tree.
1 2 | tree.as.data.frame(tree, minimal.columns = FALSE,
order.visually = TRUE)
|
tree |
input phylo object |
minimal.columns |
boolean, whether to yield a limited number of columns. When TRUE, only the following columns are produced: 'label', 'node', and columns corresponding to any tags in the tree. Defaults to FALSE. |
order.visually |
boolean, indicating whether to sort the returned data frame according to how the nodes of the tree would be arranged along the y-axis in a 2D phylogram plot. (e.g., ((a,b)1,c)2 would produce an order: [a,1,b,2,c] |
data frame with at least the following columns:
labelstring, the node or tip label, or NA
nodeinteger, the node index of the current node
[tags]If the phylo object has any attached
tags (see get.tags
and
get.tag
), each unique tag will be
incorporated as an additional column. The
rbind.fill
function from plyr
is used to combine the tags from different nodes into one
overall data frame.
If the parameter
minimal.columns
is set to FALSE, the following
columns will be added:
depthinteger, the number of nodes between this node and the furthest leaf. Leaves have a depth of 1, and the root node has the highest depth.
is_leafboolean, indicates whether this row is a leaf (TRUE) or an internal node (FALSE)
parentinteger, the node index of the parent node (or NA for the root node)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.