recombinator: Turn nested lists into data.frames.

Description Usage Arguments Details Value Note

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

1
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 documentation built on May 2, 2019, 9:39 a.m.