Convert list column into multiple rows

Viewed 965

I have a tibble where each column contains a list. Need to convert this into separate rows.

Below is the code.

library(tibble)
dataList = tibble(month_list = list(c("01", "02", "03", "04", "05", "06")) , year = 2017, 
                  pdays = list(c("31", "7", "31", "30", "31", "31")), 
                  apis = '05-001', 
                  formation_code = list(c("Java", "Java", "Java", "Java", "JS", "Java")))

dataList = add_row(dataList, month_list = list(c('01', '02')) , year = 2017, 
                  pdays = list(c("31", "30")), 
                  apis = '06-001', 
                  formation_code = list(c("JS", "Java")))

View(dataList)

enter image description here

I need the output like the shown below.

enter image description here

0 Answers
Related