Learn R Programming

shinyTree (version 0.3.1)

dfToTree: Converts a data.frame to a data.tree format

Description

Converts a data.frame to a data.tree format

Usage

dfToTree(df, hierarchy = colnames(df))

Value

nested list

Arguments

df

data.frame

hierarchy

ordered character vector of column names defining the hierarchy

Author

Jasper Schelfhout jasper.schelfhout@openanalytics.eu

Examples

Run this code
if (FALSE) {
df <- data.frame(Titanic)
tree <- dfToTree(df, c("Sex", "Class", "Survived"))
}

Run the code above in your browser using DataLab