I have following data
A B C D
1 1501583974 <list [3]> <tibble>
1 1501616585 <list [3]> <tibble>
1 1501583344 <list [3]> <tibble>
1 1501573386 <list [3]> <tibble>
Code I have used
data %>%
unnest_wider(c, names_sep="_") %>%
unnest_wider(d, names_sep="_")
Gives output
A B C_1 C_2 C_3 D_1 D_2
1 1501583974 1 2 3 <list [1]> <list [1]>
1 1501616585 1 2 3 <list [1]> <list [1]>
1 1501583344 1 2 3 <list [1]> <list [1]>
1 1501573386 1 2 3 <list [1]> <list [1]>
and then unnest_wider() again on all the columns is very tedious.
How to design a loop which works until all the columns with lists are not unnested?
Thanks