是否有一种"tidyverse"方式来加入data.frames列表(一个la full_join(),但是对于> 2个data.frames)?作为调用的结果,我有一个data.frames列表map().我以前曾经Reduce()做过类似的事情,但是想把它们合并为管道的一部分 - 只是没有找到一种优雅的方法来做到这一点.玩具示例:
library(tidyverse)
## Function to make a data.frame with an ID column and a random variable column with mean = df_mean
make.df <- function(df_mean){
data.frame(id = 1:50,
x = rnorm(n = 50, mean = df_mean))
}
## What I'd love:
my.dfs <- map(c(5, 10, 15), make.df) #%>%
# <<some magical function that will full_join() on a list of data frames?>>
## Gives me the result I want, but inelegant
my.dfs.joined <- …Run Code Online (Sandbox Code Playgroud)