After using the map function, I ended up with a list of tibbles with different number of rows. As suggested in the purr documentation (https://purrr.tidyverse.org/reference/map_dfr.html?q=map_dfr#null), I used list_cbind() to convert them into a single tibble. However, because of their different number of rows, I get an error message.
A simplified example below:
a1 <- tibble(
name1 = c(1,2,3)
)
a2 <- tibble(
name2 = c(1,2,3)
)
a3 <- tibble(
name3 = c(1,2)
)
A <- list(a1, a2, a3)
list_cbind(A)
and I get the following error message:
Error in `list_cbind()`:
! Can't recycle `..1` (size 3) to match `..3` (size 2).
Run `rlang::last_error()` to see where the error occurred.`
I also tried this (size = An optional integer size to ensure that every input has the same size (i.e. number of rows)) but the same error still occurs.
list_cbind(list(a1, a2, a3), size = 2)
Any suggestions how to do it using the tidyverse (or otherwise)?