I have two sets of data that were imported. The second set of data has only one column which corresponds with 44 out of 86 of the rows in the first data set. How can I form a new data set which only involves the data of the rows that appear in both data sets. The names of the columns are different.
I am not in a position to publish the data being use, there for code below is along the same lines but not exactly the same. However, as I am trying to select 44 rows choosing the lines isn't an option.
df1:
Fruit Circumference Weight
Apple 10 20
Orange 13 30
Pear 10 21
Kiwi 7 15
Cherry 3 10
Strawberry 4 13
Blueberry 2 5
df2:
Fruit Name
Orange
Cherry
Blueberry
New data:
Fruit Circumference Weight
Orange 13 30
Cherry 3 10
Blueberry 2 5