Skip to contents

Unnest a nested data.table wider. This might be a useful function for other purposes but will need testing. For now it should at least work with the nested structures that come from P2 JSONs

Usage

p2_unnest(data, colname)

Arguments

data

data.table

colname

character, column to unnest

Value

unnested data.table, modified in place (unless the column needs to be unnested longer)

Note

Assumes for speed that elements of each column are either all named or all unnamed. List columns with variable length are filled with NAs during unnesting.