{"id":45,"date":"2020-12-18T03:42:30","date_gmt":"2020-12-18T03:42:30","guid":{"rendered":"https:\/\/ap.pstek.nl\/pstek_wp\/blog\/?p=27"},"modified":"2022-06-21T03:01:37","modified_gmt":"2022-06-21T03:01:37","slug":"limer-code-examples","status":"publish","type":"post","link":"https:\/\/ap.pstek.nl\/pstek_wp\/2020\/limer-code-examples\/","title":{"rendered":"limer code examples"},"content":{"rendered":"\n
limer<\/a><\/strong> is an R package that enable R users to connect directly to a Lime Survey installation via its API (for details, see earlier post<\/a>), essentially giving you remote control and a possibility of automating certain procedures.<\/p>\n\n\n\n Because the documentation of limer and the Lime Survey API<\/a> is a bit minimal and therefore quite confusing for a first-time user, I give some simple coding examples below to get you started.<\/p>\n\n\n\n First, we connect to our Lime Survey instance, which is installed at The first example is a simple one that uses a built-in function from limer, The second example requires greater knowledge of the LimeSurvey API language because the limer package does not have a neat wrapper for these functions. Instead the generic LIMESURVEY.URL<\/code> and can be accessed with a
LIME.USERNAME<\/code> and
LIME.PASSWORD<\/code>. Obviously you should replace these with your own installations’ details in the code below. The
get_session_key()<\/code> command gets you a unique key through which you can securely access the Lime Survey installation. This is automatically used in all the
limer<\/code> calls.<\/p>\n\n\n\n
library(limer)\n\n#LimeSurvey Server Info\noptions(lime_api = 'https:\/\/LIMESURVEY.URL\/index.php\/admin\/remotecontrol')\noptions(lime_username = 'LIME.USERNAME')\noptions(lime_password = 'LIME.PASSWORD')\n\nget_session_key()<\/code><\/pre>\n\n\n\n
get_responses<\/code>. This simply allows you to download all the data (or only completed data) from a particular survey, #10001 in this case.<\/p>\n\n\n\n
responses <- get_responses(10001, sCompletionStatus = 'all')<\/code><\/pre>\n\n\n\n
call_limer<\/code> function is used in which calls from the original API can be introduced. The full guide of these API functions is available here<\/a>. <\/p>\n\n\n\n