r - 将两个大数据集合并在一起

标签 r merge dataframe

这是我的两个数据框,都有相同的行数,即 70492,我想将它们合并在一起,

这不会将我的数据框合并在一起

final <- merge(DF1,DF2)    

我得到的错误是

Error: cannot allocate vector of size 2.1 Gb
In addition: Warning messages:
1: In merge.data.frame(as.data.frame(x), as.data.frame(y), ...) :
  Reached total allocation of 1535Mb: see help(memory.size)

数据示例:

> Df1                       

  DaysInHospital    

1      0.7083160
2      0.7855017
3      1.4028831
4      0.5711540 
5      0.7084526
6      0.7035213

> DF2 

   MemberID ClaimsTruncated
1 20820036               0
2 14625274               1
3 99227820               0
4 74486714               0
5 92341995               0
6  7127539               0

最佳答案

您必须有一些共同的列才能合并。根据您的描述,行数相同,只是......

final <- cbind(df1, df2)

关于r - 将两个大数据集合并在一起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9612223/

相关文章:

r - 在R中创建动态文件名时遇到问题

git - git 中 "Resolve using theirs"的默认行为是什么

python - 我如何抵消 Pandas dayofyear 以便开始日期是 10 月 1 日而不是 1 月 1 日?

python - Pandas 从一个值中减去所有值,移动到下一个值并重复

python - 使用python在数据框中的某些列中删除具有相同值的行

r - ggplot 函数内 aes(...) 中变量的范围

r - 在 R 中反转三角矩阵的方法是什么?

mysql - SQL 列合并

python - 将多个 CSV 文件合并到...并具有最大大小限制

arrays - 使用最小堆实现排序数组的 K 路合并