You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have encounter with the necessity of joining several tibbles, which i have nested in a list. This can be easily done using reduce function from purrr package:
library(dplyr)
library(purrr)
df1 <- tibble(
index = 1:4,
values = 5:8
)
df2 <- tibble(
index = 2:4,
first = 6:8
)
df3 <- tibble(
index = 3:4,
second = 7:8
)
df_list <- list(df1, df2, df3)
df_join <- df_list |>
reduce(left_join, by = "index")
But taken into consideration that bind_cols from dplyr already allows working with lists of data frames I think it could be a great feature the possibility of joining list of dataframes using join functions.
The text was updated successfully, but these errors were encountered:
I have encounter with the necessity of joining several tibbles, which i have nested in a list. This can be easily done using
reduce
function frompurrr
package:But taken into consideration that
bind_cols
fromdplyr
already allows working with lists of data frames I think it could be a great feature the possibility of joining list of dataframes usingjoin
functions.The text was updated successfully, but these errors were encountered: