# NOT RUN {
df <- dplyr::starwars
# Un-named list columns
spread_list(df, films, replace = FALSE) %>%
dplyr::select(name, dplyr::starts_with("films")) %>%
head(8)
# Named (and un-nammed) list columns
df <- dplyr::tibble(id = 1:3, platform = list(
list("fb" = 1, "ig" = 2),
list("fb" = 3),
list()
))
spread_list(df, platform, str = "ptf_")
# }
Run the code above in your browser using DataLab