If my first data frame is like this with two categories, Seq and Level
Seq Level
AAA 1
BBB 2
CCC 3
And my second data frame like this where multiple of the Anno category can map to a single value of the Seq category
Anno Seq
A-1 AAA
B-1 AAA
C-1 BBB
D-1 BBB
E-1 BBB
F-1 CCC
How would I match and merge the 2 dataframes together such that they would form something like this
Anno Seq Level
A-1; B-1 AAA 1
C-1; D-1; E-1 BBB 2
F-1 CCC 3
I've tried using the match function in order to find the same Seq from df2 then use that as an index to add the Anno to df1. However, this seems to only find the first matched value and ignores all afterwards.