合并多个data.tables [英] Merging multiple data.tables

查看:25
本文介绍了合并多个data.tables的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以使用 merge 函数或 [.data.table 函数合并(连接)两个 data.table.但是,如果我说 10, data.tables 并想使用 do.call 将它们全部合并在一起,是否有一个函数可以做到这一点?目前我求助于 do.call(cbind, ...) ,它只适用于非常特殊的情况.

I am aware that one can merge (join) two data.table with the merge function or the [.data.table function. However, if I have say 10, data.tables 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,...))

这篇关于合并多个data.tables的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆