I have conducted a survey with limesurvey and have exported the results as csv.-file, which I import into R.
One of the questions is a multiple choice question, in which the participants could name the subjects they study. The output from limesurvey looks somewhat like this (but with more subjects and more participants):
Participant | Maths | Physics | English | Biology
1 | Y | | Y |
2 | | Y | Y |
3 | Y | Y | | Y
I'd like to get a result that looks like this
Participant | Subject 1 | Subject 2| Subject 3 |
1 | Maths | English | |
2 | Physics | English | |
3 | Maths | Physics | Biology |
I'd be grateful for any pointers.
Here's my attempt to generate the expected dataframe as requested: