powered by
Turns each element of a list-column into a row.
unnest_longer.( .df, col, values_to = NULL, indices_to = NULL, indices_include = NULL, keep_empty = FALSE, names_repair = "check_unique", simplify = NULL, ptype = NULL, transform = NULL )
A data.table or data.frame
Column to unnest
Name of column to store values
Name of column to store indices
Should an index column be included? Defaults to TRUE when col has inner names.
TRUE
col
Return NA for any NULL elements of the list column
NA
NULL
Treatment of duplicate names. See ?vctrs::vec_as_names for options/details.
?vctrs::vec_as_names
Currently not supported. Errors if not NULL.
Optionally a named list of ptypes declaring the desired output type of each component.
Optionally a named list of transformation functions applied to each component.
df <- tidytable( x = 1:3, y = list(0, 1:3, 4:5) ) df %>% unnest_longer(y)
Run the code above in your browser using DataLab