tree.as.data.frame: Create a data frame from a phylo object where each row...

Description Usage Arguments Value

Description

Create a data frame from a phylo object where each row corresponds to a node in the tree.

Usage

1
2
  tree.as.data.frame(tree, minimal.columns = FALSE,
    order.visually = TRUE)

Arguments

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]

Value

data frame with at least the following columns:

  1. labelstring, the node or tip label, or NA

  2. nodeinteger, the node index of the current node

  3. [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:

  1. 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.

  2. is_leafboolean, indicates whether this row is a leaf (TRUE) or an internal node (FALSE)

  3. parentinteger, the node index of the parent node (or NA for the root node)


gjuggler/ggphylo documentation built on May 17, 2019, 6:05 a.m.