Trying to merge multiple csv files in R

前端 未结 6 1103

I\'m attempting to merge multiple csv files using R. all of the CSV files have the same fields and are all a shared folder only containing these CSV files. I\'ve attempted

6条回答
  •  佛祖请我去吃肉
    2020-12-03 22:22

    If all your csv files have exactly the same fields (column names) and you want simply to combine them vertically, you should use rbind instead of merge:

    > a
                 A         B
    [1,]  2.471202 38.949232
    [2,] 16.935362  6.343694
    > b
                A          B
    [1,] 0.704630  0.1132538
    [2,] 4.477572 11.8869057
    > rbind(a, b)
                 A          B
    [1,]  2.471202 38.9492316
    [2,] 16.935362  6.3436939
    [3,]  0.704630  0.1132538
    [4,]  4.477572 11.8869057
    

提交回复
热议问题