unnest | R Documentation |
Transforms list columns to separate columns, possibly by reference. The original columns are removed from the returned table. All non-atomic objects in the list columns are expand to new list column.
unnest(x, cols, prefix = NULL)
x |
( |
cols |
( |
prefix |
( |
(data.table::data.table()
).
x = data.table::data.table(
id = 1:2,
value = list(list(a = 1, b = 2), list(a = 2, b = 2))
)
print(x)
unnest(data.table::copy(x), "value")
unnest(data.table::copy(x), "value", prefix = "{col}.")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.