How to flatten the list with duplicated names?

l1 <- list(tibble(a = 1), tibble(b = 2))
l2 <- list(tibble(a = 3), tibble(b = 4))

We wish to get the format like this:
a b
1 2
3 4

tibble(l1, l2) |> unnest(cols = c(l1, l2), names_repair = "unique")
or
bind_rows(l1, l2)

didn't work,

Thanks.

Try

bind_rows(unlist(l1), unlist(l2))

Jw

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.