I have a data set that might contain some very similar keys - something like a row of data for each of the email address john.doe@foo.com and john.m.doe@foo.com. How can I combine similarly named keys and do an aggregate in R?
Sample input
|Email | Subscriptions |
-------------------------------------
|john.doe@foo.com | 10 |
|john.m.doe@foo.com | 11 |
|jane.doe@foo.com | 20 |
Expected result
|Email | Subscriptions |
-------------------------------------
|john.doe@foo.com | 21 |
|jane.doe@foo.com | 20 |
I know agrep and few other libraries can do fuzzy matching, but how do I employ it in combining rows in a data set?