I have data that includes a group (Area) and then also provides a name. I am trying to merge two data frames. One frame is much smaller and is the "mapping" data frame. It has one row for each Name within an Area. The other frame is much larger and is the "instances" data frame. It has many rows with variations of the names with the Area. I want the info from the mapping frame to be merged to the instances frame so that each instance has the information that the mapping frame provides accorded to it.
I have looked into the Fuzzy package but have not found a way to implement it within groups (Area column) or how to effectively use it with cells that hold multiple strings and trying to match based on that.
Below is a sample of similar data. The merge needs to pull the relevant info from the instances data frame in order to map it to the mapping data frame.
Mapping Dataframe
Area Name
A Apple
A Orange Strawberry
A Blackberry Rasberry
B Blackberry
C Kiwi
C Apple
Instances Dataframe
Area Locale
A Apple Pear Tomato
A Orange Potato Strawberry Zuccini
A Blackberry Rasberry
B Blackberry Onion
B Lettuce Blackberry Cucumber
C Kiwi Spinach Pineapple
C Kiwi Potato
C Apple Cucumber
C Apple Potato
The goal is to get a frame that looks like below.
Dataframe
Area Locale Name
A Apple Pear Tomato Apple
A Orange Potato Strawberry Zuccini Orange Strawberry
A Blackberry Rasberry Blackberry Rasberry
B Blackberry Onion Blackberry
B Lettuce Blackberry Cucumber. Blackberry
C Kiwi Spinach Pineapple Kiwi
C Kiwi Potato Kiwi
C Apple Cucumber Apple
C Apple Potato Apple