I have list of 100,000 dataframes and want to full join them into one dataframe.
I tried Reduce
but it is very slow. This is example of my code:
dfs <- list(
df1 = data.frame(a = 1:3, b = c("a", "b", "c")),
df2 = data.frame(c = 4:6, b = c("a", "c", "d")),
df3 = data.frame(d = 7:9, b = c("b", "c", "e"))
)
z <- dfs %>%
Reduce(function(dtf1,dtf2) dplyr::full_join(dtf1,dtf2), .)
Can someone give any suggestion to optimize this full_join function?