I am trying to create a merged data frame from two existing data frames. However, the key used for merge has non-unique entries in one of the dataframes. So for multiple instances of this key, I want to have multiple rows/entries in the new dataframe, with some modifications/update applied on the entry values while merging.
The existing type of data frame/tables and the result dataframe
I have tried using merge (only for combining the 2 dataframes and not modifying the data) I got the following error: Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column. I doubt if merge function works in my scenario. I am a novice in R, and would really appreciate some help and guidance with this. Please let me know if any more information about the data or the result will help you better understand the problem.