tree_to_df: Tree to Data.Frame

Description Usage Arguments Value

View source: R/DataFrame_Functions.R

Description

Function to convert data.tree object back to a data.frame, with all attrs. By using ToDataFrameTable, you would get only the leaf-level information. ToDataFrameTree gives aggregate values calculated at the different levels of the hierarchy as well, which is needed to compute values for metrics at each of the levels.

Usage

1
tree_to_df(node, ..., attrs = NULL, attributes_only = TRUE)

Arguments

node

a data.tree Node object

attrs

character, optional. Attributes to be included in the output. If not provided, will default to include all attributes present in the data.tree.

attributes_only

logical, optional. If TRUE, the default, only attribute columns and pathString are returned in the data.frame. If FALSE columns added by the function ToDataFrameTree are also returned. These include name, levelName, and level, which can be useful to have if you intend to rank nodes by level based on some attribute (or function of attributes).

Value

data.frame


aecoleman/aggrtree documentation built on Nov. 1, 2019, 8:58 p.m.