mattroumaya / surveymonkey

Access your SurveyMonkey data directly from R!
https://mattroumaya.github.io/surveymonkey/
Other
42 stars 10 forks source link

Duplicate error #115

Closed sarahmovementecon closed 1 year ago

sarahmovementecon commented 1 year ago

I have been using your package for about a month and am really appreciating it so much. Today I ran my code to pull data from survey monkey using your package and I received the following error:

Error: There are duplicated rows in the responses. To proceed and retain duplicates, re-run this function with fix_duplicates = 'keep' To proceed with dropped duplicates, re-run with fix_duplicates = 'drop' If this is unexpected - file a bug report at https://github.com/mattroumaya/surveymonkey/issues

I tried to add the function as another line as shown below, but that did not work.

survey_english <- 402595717 %>% fetch_survey_obj %>% parse_survey %>% strip_html %>% fix_duplicates = 'keep'

I am pulling data from two different surveys and only received the error on one of the surveys. The survey that generated the error was also hit by bots last week and has a really large number of rows, but from what I have seen they are not duplicated.

Please let me know if this is a known issue that I can easily resolve. I really hope to continuing using this very useful package.

mattroumaya commented 1 year ago

Hey @sarahmovementecon! Glad you are finding the package useful.

It's hard to know why your survey might be pulling duplicates, but if you know you want to keep them, you can do so like this:

survey_english <- 402595717 %>%
fetch_survey_obj %>%
parse_survey(fix_duplicates = 'keep') %>%
strip_html

fix_duplicates is an argument to the parse_survey() function, so that's why the code you have probably wasn't working.

Let me know if this resolves the error!

sarahmovementecon commented 1 year ago

Hi Matt,

Thank you so much for your quick reply. I did not get the same error, but am now receiving a different error message:

Error in dplyr::bind_cols():! Can't recycle survey_id (size 12678) to match ..41786 (size 2).

Any ideas on what could be causing this? This had been working fine previously and nothing has changed about the survey, except that I have a lot more observations now and also added some new collectors. My code is also still working fine on a separate survey that I have been pulling data from. I really appreciate your help with this!

Sarah

On Wed, Nov 23, 2022 at 8:20 AM Matt Roumaya @.***> wrote:

Hey @sarahmovementecon https://github.com/sarahmovementecon! Glad you are finding the package useful.

It's hard to know why your survey might be pulling duplicates, but if you know you want to keep them, you can do so like this:

survey_english <- 402595717 %>%fetch_survey_obj %>% parse_survey(fix_duplicates = 'keep') %>%strip_html

fix_duplicates is an argument to the parse_survey() function, so that's why the code you have probably wasn't working.

Let me know if this resolves the error!

— Reply to this email directly, view it on GitHub https://github.com/mattroumaya/surveymonkey/issues/115#issuecomment-1325332739, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4K34H5H6WYMNHQE527KP3LWJY74RANCNFSM6AAAAAASINZZBM . You are receiving this because you were mentioned.Message ID: @.***>

mattroumaya commented 1 year ago

Hi Sarah - sorry for the late reply! Were you able to resolve this?

mattroumaya commented 1 year ago

Closing out for now, but please re-open if this pops up again!

mfernandes3 commented 1 year ago

Same error for me! Works for some survey IDs but for others I get this. Tried keep and drop here parse_survey(fix_duplicates = 'keep')