Skip to content

flatten() #6

@garyfeng

Description

@garyfeng

Need something to turn a list of lists to a matrix, and possibly to a df.

Say we have df$var <- list(list(key1="val1"), list(key1="this", key2="that")).

flatten(df$var) should give a matrix/df with column names = c("key1", "key2"), with values and missing values filled with NA.

This function (http://www.inside-r.org/packages/cran/plyr/docs/rbind.fill.matrix) is going to handy. See also http://stackoverflow.com/questions/18960541/r-flatten-variably-sized-list-of-lists-to-data-frame

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions