knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
# devtools::install_github("rmhogervorst/badgecreatr") # badgecreatr::badgeplacer(status = "wip" , githubaccount = "kalimu",githubrepo = "LimeRick") #[![minimal R version](https://img.shields.io/badge/R>=-3.3.1-6666ff.svg)](https://cran.r-project.org/)
Bridge between R and LimeSurvey
by Kamil Wais, Ph. D. (homepage / contact)
The package homepage: http://www.wais.kamil.rzeszow.pl/LimeRick/
The LimeSurvey homepage: http://limesurvey.org
# install.packages('devtools') devtools::install_github("kalimu/LimeRick")
library(LimeRick)
# set link to the LimeSurvey API on the demo remote server options(lsAPIurl = 'http://odgar.pl/survey/index.php/admin/remotecontrol') # set LimeSurvey user login data for survey testing purposes options(lsUser = "LimeRickDemo") options(lsPass = "LimeRickDemo")
# low-level API call lsAPI(method = "release_session_key") # API call using a wrapper function lsSessionKey("release")
# getting session key for the user and saving it inside a special environment lsSessionKey("set") # if you work with specific local set it now Sys.setlocale("LC_ALL", "Polish")
# listing available surveys (surveyList = lsList("surveys")) # extracting ID of demo survey surveyID = surveyList$sid[1]
# try submit your own answers to the demo survey browseURL(paste0("http://odgar.pl/survey/index.php/survey/index/sid/", surveyID))
or use this link: http://odgar.pl/survey/index.php/survey/index/sid/683736
questionList = lsList("questions", surveyID)
We can access 22 question properties and 58 survey properties. For example:
# Is the survey active? (Y - Yes) lsGetProperties('survey', surveyID)$active # What is the main text of a given question? lsGetProperties('question', surveyID, 16)$question # Is the question mandatory? (Y - Yes) lsGetProperties('question', surveyID, 16)$mandatory
lsGetSummary(surveyID)
d = lsGetResponses(surveyID, completionStatus = 'complete') tail(d)
# showing possible options for a particular question lsGetAnswerOptions(surveyID, questionID = 16) # specifying a response with the use of question code: surveIDXgroupIDXquestionID response = list('683736X2X27' = "LimeRick", '683736X2X26' = "Adding feedback directly from R", '683736X2X16' = "A2",# Academia '683736X2X21' = "174" # Poland ) # adding the above response lsAddResponse(surveyID, response) # or adding via wrapper function lsAddFeedback(feedback = "Good job! (Kamil, Poland)", sector = "academia", country = "Poland")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.