sfirke / Rmonkey

A Survey Monkey R Client
http://cloud.r-project.org/package=Rmonkey
0 stars 1 forks source link

survey_questions returns NA for answerchoice_id when question_type = matrix, question_subtype = menu, #11

Open sfirke opened 7 years ago

sfirke commented 7 years ago

It creates pairs of rows where one has answerchoice_text = NA, the next has answerchoice_text = "Other (Describe)"

For my own debugging purposes, one case is question_id 97570255.

sfirke commented 7 years ago

Looks like it's matrix, menu questions with Other (Describe) options - these create a duplicate row for each subquestion_id. Might be happening in those nested for-loops but they are hard for me to read and debug. I could fix at the end for now but that seems more patchy.

 df %>%
    filter(!is.na(subquestion_id)) %>%
    group_by(subquestion_id) %>%
    filter(n() > 1) %>%
    filter(sum(is.na(answerchoice_id)) > 0) 
sfirke commented 7 years ago

I've filtered out the seemingly problematic rows above, but a separate issue is that the open-ended responses are coming in with a blank subquestion_id. For reference, respondent 6140321370, question_id 97570255.