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

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

问题描述

我知道可以通过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.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,...))

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

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