问题 I have a data set that contains answers to a "select as many as apply" question with each possible answer in separate columns. So, assuming our question is "What color shirt is acceptable to you?" it looks something like this: id Q3_Red Q3_Blue Q3_Green Q3_Purple 9 8 Green Purple 7 Green 6 Red 5 Purple 4 Blue 3 Blue Purple 2 Red Blue Green 1 Red Purple 10 Red Purple Which you can make into an actual data frame with: tmp <- data.frame("id" = c(009,008,007,006,005,004,003,002,001,010), "Q3_Red"