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/)

LimeRick

Project Status: active CRAN_Status_Badge rstudio mirror downloads

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

LimeRick: motivation

LimeRick: tutorial

Installing developer version from GitHub

# install.packages('devtools')
devtools::install_github("kalimu/LimeRick")

Loading the installed package

library(LimeRick)

Configuring access to a survey

# 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

# low-level API call
lsAPI(method = "release_session_key")

# API call using a wrapper function
lsSessionKey("release")

Setting a connection to a survey

# 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

# listing available surveys
(surveyList = lsList("surveys"))

# extracting ID of demo survey
surveyID = surveyList$sid[1] 

Adding responses via on-line survey questionaire

# 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

questionList = lsList("questions", surveyID)

Accessing survey or question properites

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

Checking survey response

lsGetSummary(surveyID)

Importing responses into R

d = lsGetResponses(surveyID, completionStatus = 'complete')
tail(d)

Adding responses via R

# 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:



kalimu/LimeRick documentation built on May 20, 2019, 6:32 a.m.