https://github.com/kalimu/limerick
Bridge between LimeSurvey and R (and Shiny)
https://github.com/kalimu/limerick
limerick limesurvey
Last synced: over 1 year ago
JSON representation
Bridge between LimeSurvey and R (and Shiny)
- Host: GitHub
- URL: https://github.com/kalimu/limerick
- Owner: kalimu
- License: other
- Created: 2016-08-01T07:14:32.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-29T09:54:57.000Z (over 9 years ago)
- Last Synced: 2025-04-12T00:13:36.793Z (over 1 year ago)
- Topics: limerick, limesurvey
- Language: R
- Homepage:
- Size: 59.6 KB
- Stars: 29
- Watchers: 7
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
```{r, echo = FALSE}
# devtools::install_github("rmhogervorst/badgecreatr")
# badgecreatr::badgeplacer(status = "wip" , githubaccount = "kalimu",githubrepo = "LimeRick")
#[](https://cran.r-project.org/)
```
LimeRick
==========
[](http://www.repostatus.org/)
[](https://cran.r-project.org/package=LimeRick)
[](https://github.com/metacran/cranlogs.app)
Bridge between R and LimeSurvey
by Kamil Wais, Ph. D. ([homepage / contact](http://www.wais.kamil.rzeszow.pl))
The package homepage:
[http://www.wais.kamil.rzeszow.pl/LimeRick/](http://www.wais.kamil.rzeszow.pl/LimeRick/)
The LimeSurvey homepage:
[http://limesurvey.org](http://limesurvey.org)
## LimeRick: motivation
* need for a bridge that connects very closely two important open-sorce projects (R and LimeSurvey)
* need for an advanced tool that allow for:
* quickly importing responses into R from active on-line surveys
* automatically accessing properties of survey and questions
* montoring survey status and responses directly from R
* adding new responses to a survey directly from R
* simplifying workflow for reproducible analysis
(by providing in advance structured data schema)
* developing data products based on real-time declarative data collection
(ex. continous on-line tracking studies)
* collecting meta-data of respondents interactions with on-line surveys
on unique low-granular level
## LimeRick: tutorial
### Installing developer version from GitHub
```{r, echo=TRUE, eval=FALSE, cache=FALSE}
# install.packages('devtools')
devtools::install_github("kalimu/LimeRick")
```
### Loading the installed package
```{r, echo=TRUE, eval=TRUE, cache=FALSE}
library(LimeRick)
```
### Configuring access to a survey
```{r, echo=TRUE, eval=TRUE, cache=FALSE}
# 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 function calls vs. function wrappers
```{r, echo=TRUE, eval=TRUE, cache=FALSE}
# low-level API call
lsAPI(method = "release_session_key")
# API call using a wrapper function
lsSessionKey("release")
```
### Setting a connection to a survey
```{r, echo=TRUE, eval=TRUE, cache=FALSE}
# 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
```{r, echo=TRUE, eval=TRUE, cache=FALSE}
# listing available surveys
(surveyList = lsList("surveys"))
# extracting ID of demo survey
surveyID = surveyList$sid[1]
```
### Adding responses via on-line survey questionaire
```{r, echo=TRUE, eval=FALSE, cache=FALSE}
# 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
### Listing survey questions
```{r, echo=TRUE, eval=TRUE, cache=FALSE}
questionList = lsList("questions", surveyID)
```
### Accessing survey or question properites
We can access 22 question properties and 58 survey properties. For example:
```{r, echo=TRUE, eval=TRUE, cache=FALSE}
# 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
```
### Checking survey response
```{r, echo=TRUE, eval=TRUE, cache=FALSE}
lsGetSummary(surveyID)
```
### Importing responses into R
```{r, echo=TRUE, eval=TRUE, cache=FALSE}
d = lsGetResponses(surveyID, completionStatus = 'complete')
tail(d)
```
### Adding responses via R
```{r, echo=TRUE, eval=TRUE, cache=FALSE}
# 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")
```
## See also:
* LimeSurvey Project Team / Carsten Schmitz (2015). / LimeSurvey: An Open Source survey tool /LimeSurvey Project Hamburg, Germany. URL http://www.limesurvey.org