Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

recombinator

Turn nested lists into data.frames.


Description

A mini-utility package for turning nested lists into data.frames.

A recombinator attempts to convert a depth 2 nested list into a data.frame.

Usage

recombinator(dat, id = "id")

Arguments

dat

list. The list of lists to process. It can be in homogeneous or heterogeneous format (see the description).

id

character. Primary key, by default "id".

Details

There are two supported formats.

  1. Homogeneous lists A list where the first list element is a character vector giving the names of the data.frame, and the subsequent list elements themselves lists of values.

  2. Heterogeneous lists A list where each element is a named list of values. In this format, plyr::rbind will be used to take the union of all names and impute the ones missing with NA values.

Value

the converted data.frame. If not a list, no changes will be performed.

Note

A warning will be issued if non-standard names (i.e. those containing more than alphanumeric, underscore, and period characters) are used.


recombinator

Recombinate Nested Lists to Dataframes

v1.0.1
MIT + file LICENSE
Authors
Peter Hurford [aut, cre], Robert Krzyzanowski [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.