data.frameInteractive Reingold-Tilford tree diagram created using D3.js, where every node can be expanded and collapsed by clicking on it.
# S3 method for data.frame
collapsibleTree(df, hierarchy,
root = deparse(substitute(df)), inputId = NULL, width = NULL,
height = NULL, attribute = "leafCount", aggFun = sum,
fill = "lightsteelblue", fillByLevel = TRUE, linkLength = NULL,
fontSize = 10, tooltip = FALSE, ...)a data frame from which to construct a nested list
a character vector of column names that define the order
and hierarchy of the tree network. Applicable only for data.frame input.
label for the root node
the input slot that will be used to access the selected node (for Shiny). Will return a named list of the most recently clicked node, along with all of its parents.
width in pixels (optional, defaults to automatic sizing)
height in pixels (optional, defaults to automatic sizing)
numeric column not listed in hierarchy that will be used for tooltips, if applicable. Defaults to 'leafCount', which is the cumulative count of a node's children
aggregation function applied to the attribute column to determine values of parent nodes. Defaults to `sum`, but `mean` also makes sense.
either a single color or a vector of colors the same length as the number of nodes. By default, vector should be ordered by level, such that the root color is described first, then all the children's colors, and then all the grandchildren's colors.
which order to assign fill values to nodes.
TRUE: Filling by level; will assign fill values to nodes vertically.
FALSE: Filling by order; will assign fill values to nodes horizontally.
length of the horizontal links that connect nodes in pixels. (optional, defaults to automatic sizing)
font size of the label text in pixels
tooltip shows the node's label and attribute value.
unused; included to match with the generic function
Other collapsibleTree functions: collapsibleTree.Node,
collapsibleTree