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
  • 211,554
  • 25
  • 370
  • 453
TomTe
  • 193
  • 9

1 Answers1

2

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
  • 6,571
  • 1
  • 18
  • 41
  • 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