How to separate text responses in R?

0

I'm sure my doubt should be super simple to be solved so far I have not had any positive results in any of the tutorials I've accessed.

I'm working on a df in the R there is a column that the answers were separated by; that is, each participant could answer one more option (Example: Knowledge mapping, Automatic feedback, Artificial intelligence, Collaboration and co-authorship). I need to separate the answers so that I can identify how many users answered each of the options without changing the number of participants / respondents.

Thank you very much, Priscilla.

    
asked by anonymous 15.10.2018 / 22:01

1 answer

3

Use the multi.split function of the questionr package. To view the result, use multi.table .

v <- c("red,blue","green","red,green","blue,red")
multi.split(v, split.char = ",")
## Tabela de frequências
multi.table(multi.split(v, split.char = ","))

        n %multi
v.blue  2     50
v.red   3     75
v.green 2     50
    
25.10.2018 / 02:35