cloudyr / limer

A LimeSurvey R Client
MIT License
67 stars 37 forks source link

getResponses() for one question #56

Open domelia opened 2 years ago

domelia commented 2 years ago

Hello, I've tested the limer package and found it very useful and promising, thak you very much for your work. Is there possibility to export results only for one question? I'm working on a project to visualize stats for active surveys grouped by one variable. Exporting all results is too slow, taking into account that I need only one question to examine.

Best regards, Daria Omelchenko

forstem6 commented 2 years ago

Hi,

I hope it is still relevant. You can export only parts with: get_responses(<yourSurveyID>, iFromResponseID = <firstparticipant>, iToResponseID = <lastparticipant>, aFields = c("qcode_of_your_first_question_you_want_to_export", "qcode_of_your_second_question_you_want_to_export"))

Two notes: You need to specify the range of participants you want to export, otherwise it does not work (that's what took me ages to find out). In case you do not know. The questioncodes are in the format XX. So something like 896543X198X1234SQ001. I always look them up by inspecting the survey with a Page Inspector built into your browser.

domelia commented 2 years ago

Hi, forstem6 Thank you for your reply. As the main task for my shiny app to control for the number of completed responses, it is impossible to enter every time the number of participants. Or rather, it doesn't make sense to do it manually. But your formula is very useful, I'm sure I will use it in another situation. Thank you very much.

Jan-E commented 2 years ago

What happens if you enter a number for iToResponseID that is higher than it ever should become?