buildHierarchyTree: Build a hierarchical tree from tabular data

View source: R/buildHierarchyTree.R

buildHierarchyTreeR Documentation

Build a hierarchical tree from tabular data

Description

Converts a data frame and an ordered set of columns into a nested hierarchy suitable for the Shiny input component.

Usage

buildHierarchyTree(data, levels)

Arguments

data

A data frame containing the hierarchy columns.

levels

A character vector with column names, ordered from highest to lowest hierarchy level.

Value

A list representing the hierarchy tree.

Examples

data <- data.frame(
  year = c(2026, 2026, 2026),
  month = c("January", "January", "February"),
  day = c(1, 2, 1)
)
buildHierarchyTree(data, c("year", "month", "day"))

shinyHierarchy documentation built on Oct. 2, 2026, 5:09 p.m.