I need to merge two data frames of unequal length by comparing two columns and if the context match (or is quite similar) then merge that specific row.
For example this is what data frame 1 looks like
Car horse.power price
Car1 15 NA
Car2 25 NA
Car3 55 NA
and data frame 2:
Car price
Car1 (2014) 1234
Car2 turbo 9876
I want my final data frame to look like this:
Car horse.power price
Car1 15 1234
Car2 25 9876
Car3 55 NA
How would i do that???
Thanks in advance!
EDIT: I do not understand how this is a duplicate to this one. In the linked question you have a fixed format for the customer ID. In my case you dont. If i apply the solution provided in the linked question I end up with this:
Car horse.power price
Car1 15 NA
Car1 (2014) NA 1234
Car2 25 NA
Car2 turbo NA 9876
Car3 55 NA