-3

Dataset1

 Ordernumbers   column1   column2   column3
1. 523542          x         x       x
2. 474822          x         x       x
3. 456453          x         x       x
4. 124132
5. 342142
6. 342122
7. 432522
8. 432134
9. 234234

Dataset2

transformantID   columnA   columnB   columnC
1. 124132         x         x       x
2. 234234         x         x       x
3. 342142         x         x       x
4. 474822
5. 523542         y         w       z  
6. 432522
7. 456453 

My goal is to merge these two dataframes. The column "ordernumber" from dataset1 matches vlaues with values from the column "transformantID" from dataset 2. I would like to include all rows from dataset2 in dataset1 so transformantID value matches the ordernumber value like so:

Ordernumbers   column1   column2   column3  columnA   columnB   columnC
1. 523542          x         x       x        y         w         z

And have this done for every row in the first dataset. The number of rows from dataset1 exceed those of dataset2.

David Arenburg
  • 91,361
  • 17
  • 137
  • 196

1 Answers1

1
merge( Dataset1 , Dataset2 , by.x = "Ordernumbers" , by.y = "transformantID" )
Anthony Damico
  • 5,779
  • 7
  • 46
  • 77