Merging data frames in a list
This question already has an answer here:
You can try Reduce
with merge
Reduce(function(...) merge(..., by='custID', all=TRUE), res)
# custID top_pct.x top_pct.y
#1 1 10 10
#2 2 20 20
#3 6 NA 10
#4 7 NA 20
Or as @Colonel Beauvel suggested, a more readable approach would be wrapping it with Curry
from library(functional)
library(functional)
Reduce(Curry(merge, by='custID', all=T), res)
链接地址: http://www.djcxy.com/p/24804.html
上一篇: 使用readxl软件包合并xlsx文件后,url会消失
下一篇: 合并列表中的数据帧