View source: R/buildHierarchyTree.R
| buildHierarchyTree | R Documentation |
Converts a data frame and an ordered set of columns into a nested hierarchy suitable for the Shiny input component.
buildHierarchyTree(data, levels)
data |
A data frame containing the hierarchy columns. |
levels |
A character vector with column names, ordered from highest to lowest hierarchy level. |
A list representing the hierarchy tree.
data <- data.frame(
year = c(2026, 2026, 2026),
month = c("January", "January", "February"),
day = c(1, 2, 1)
)
buildHierarchyTree(data, c("year", "month", "day"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.