0

I have two data sets as CSV files with identical columns.
I want to merge them so that they are listed one below the other.

I tried this code but this only puts them together left to right:

merge(1, 2, by="Col A") 

I am looking to list them one above the other in the merged data set, not next to each other.

enter image description here

Ben Bolker
  • 192,494
  • 24
  • 350
  • 426
TomTe
  • 173
  • 8

1 Answers1

1

You can use bind_rows() from dplyr. For a discussion why bind_rows can sometimes be preferrable over rbind() see the discussion here

one <- mtcars[1:4, ]
two <- mtcars[11:14, ]

# You can supply data frames as arguments:
bind_rows(one, two)
mnist
  • 5,277
  • 1
  • 13
  • 35
  • please mark an answer as accepted if you pleased with it so the community knows the problem is solved – mnist Oct 27 '19 at 22:57