frame2tree: Transform a data frame into a nested list.

View source: R/listManipulation.R

frame2treeR Documentation

Transform a data frame into a nested list.

Description

Takes in given columns of a data frame and transforms them into a nested list based on the column names given. Eg. if first level is c(1,1,2) and second level is c('a','b','c'), it will return a list of length 2 that includes lists named 1 and 2. List 1 will include 2 empty lists named a and b while list 2 will include 1 empty list called c.

Usage

frame2tree(frame, levels = colnames(frame))

Value

A nested list


oganm/ogbox documentation built on Feb. 18, 2024, 12:37 a.m.