Let's say I have the following dataset:
df = data.frame(Staff=c('Teaching','Research','Research,Teaching','Administration', 'Faculty Management', 'Administration, Faculty Management'), score=c('2','1','3','2','1', '2'), length=c(10, 20, 30, 5, 10, 6))
> View(df)
Staff score length
1 Teaching 2 10
2 Research 1 20
3 Research,Teaching 3 30
4 Administration 2 5
5 Faculty Management 1 10
6 Administration, Faculty Management 2 6
>
I am trying to perform an ANOVA to see if there are differences between staff roles' scores.
How can I recode the values so that if a value contains the string "Teaching" it can be recoded as just Teaching?
Or maybe a better question: How do you deal with multiple-answer questions in R?