mattroumaya / surveymonkey

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

Error: There are duplicated rows in the responses, maybe a situation like #27 #74

Closed shamahutoto closed 2 years ago

shamahutoto commented 3 years ago

Hi,

I've been reading in the same survey everyday using the same code - but today got this error: Error: There are duplicated rows in the responses, maybe a situation like #27

The survey and data should be the same as yesterday

sfirke commented 3 years ago

Bummer. I am unfortunately no longer able to maintain this package. I have changed employers and no longer use SurveyMonkey, which also means I can't really test any changes I would make anyway. I'd be willing to approve a pull request in cases where someone has a working change; alternatively, I would be happy to appoint someone else the new maintainer.

For this error, I would suggest walking backwards through the process, inspecting the survey object at each stage before it errors. So the earlier lines of parse_survey, and then walking backward through the lines of fetch_survey_obj. If the duplicate is introduced by the surveymonkey package, then it can be fixed. If it's present in the original JSON that comes back from the SurveyMonkey API, then it's an error on their side -- which seems improbable but was the case in #27 when I gave them specific survey / response / item sets to investigate.

It's probably worth adding a force_parse option to parse_survey as I proposed in #27, which could be quick and crude since it's an inelegant fix anyway. Basically it would just call distinct or group_by / arrange(date) / slice(1) to take the first record for each respondent ID. If someone writes and tests this on their own machine, I'd merge it in.

mattroumaya commented 3 years ago

@shamahutoto - any way you can provide some details about the survey you're using?

At a minimum, a description of the different question types would be a great place to start troubleshooting. For instance, do you happen to be using the contact form to collect respondent demographic data?

@sfirke - I'd be happy to help to review PRs or be added as a maintainer of this package. We use it to achieve a lot of different tasks at the org I work at, and would be more than happy to help in any way.

sfirke commented 3 years ago

Thanks Matt! I just invited you to be a maintainer of this repo, which I think should give you full control for pushing to main, merging PRs, etc. I am glad to be able to hand it to someone who is actively invested in the project 🙏

mattroumaya commented 3 years ago

Thanks @sfirke! I really appreciate all of the work you've spent developing and maintaining this over the years, and hope that I can do it justice.

jamieRowen commented 2 years ago

I have similarly hit this issue on a survey where it wasn't previously present, I will do some digging to try to understand whether or not the duplicate is present in the raw json, however at present the warning about #27 causes the parse to error and there is no escape. Would it be possible to include an argument to bypass the error and return with duplicates to be dealt with afterwards?

jamieRowen commented 2 years ago

As far as I can tell, there is only one copy of the duplicated being returned in the raw json, when I get more time I will try to understand where the duplicate comes in

jamieRowen commented 2 years ago

it looks like the duplicate appears somewhere in the parse_respondent_list()

This is a multiple choice question, each of the choices appears twice.

mattroumaya commented 2 years ago

@jamieRowen definitely feel free to put in a PR if you have a solution - I'm not able to quickly replicate the issue so am not sure where to start. If you are able to describe the question setup on your end, I should have some time this weekend to take a look!