I have this kind of dataset
Name Year Subject State
Jack 2003 Math/ Sci/ Music MA/ AB/ XY
Sam 2004 Math/ PE CA/ AB
Nicole 2005 Math/ Life Sci/ Geography NY/ DE/ FG
This is what I want as output:
Name Year Subject State
Jack 2003 Math MA
Jack 2003 Sci AB
Jack 2003 Music XY
Sam 2004 Math CA
Sam 2004 PE AB
Nicole 2005 Math NY
Nicole 2005 Life Sci DE
Nicole 2005 Geography FG
Keep in mind that the first element of 'subject' corresponds to the first of 'State' and so on. I need to keep this correspondence. I think I have to use something like 'pivot_longer' but I do not use R every day and I'm not skilled enought. Thanks in advance :) Thanks!!