I have the results of a survey that I carried out and I am unsure of how to deal with the answers to multiple choice questions where several answers are allowed.
For example, say I asked "How do you travel to work?" and one response was "On foot; by car; by bus", how can I separate the individual components of this answer to create a new column where they are all listed?
I want to see which is the most common answer.
I tried the following solution:
test <- str_split(survey$how_travel, ";")
and this returns a list with a row for each respondent but each response is nested in the 'value' column and I need to type test[[3]] to view each component of the 3rd respondent's answer. I would like each response from each respondent to appear in its own row in a new column but have no idea how. Thank you.
For example take the column:
How can I separate the individual components of each response and populate a new column with each individual component?
