Questionnaire data preparation in R