合并多个数据表 [英] Merging multiple data.tables
本文介绍了合并多个数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道可以通过merge
函数或[.data.table
函数合并(合并)两个data.table
.但是,如果我说10个data.table
,并想使用do.call
将它们全部合并在一起,是否有一个函数可以做到这一点?目前,我使用do.call(cbind, ...)
仅适用于非常特殊的情况.
I am aware that one can merge (join) two data.table
vie the merge
function or the [.data.table
function. However, if I have say 10, data.table
s and want to use do.call
to merge them all together, is there a function that would do this? Currently I resort to do.call(cbind, ...)
which works for only very special cases.
推荐答案
不确定,但可能(未测试):
Not sure, but maybe (untested) :
Reduce(merge,list(DT1,DT2,DT3,...))
这篇关于合并多个数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文