knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
qsurvey is a toolkit for working with the Qualtrics survey platform and its data in R. It focuses on testing and review of surveys before fielding, and analysis of responses afterward.
Maintained, but not under development. Use the qualtrics package, which combines qsurvey, qualtRics, and qualtricsR.
Install the latest version from GitHub:
# install.packages("devtools") devtools::install_github("jamesdunham/qsurvey")
library(qsurvey)
A Qualtrics API
key
is needed to communicate with the survey platform. Set the environment variable
QUALTRICS_KEY
to your key value. You can do this during R
startup
(recommended), interactively with
Sys.setenv()
,
or through key_from_file()
.
Qualtrics assigns each survey a unique id. You can search by survey name for an
id using find_id()
. Use surveys()
to see the ids and other metadata for all
surveys, in a table similar to the Qualtrics Control Panel overview.
Pass a survey's id to responses()
to retrieve responses. This is equivalent to
using the "Export Data" tool in the "Data and Analysis" view of the Control
Panel and then reading the resulting file into R.
r <- responses(id = "SV_0CGgkDZJaUvxnGl", verbose = FALSE)
For functions that work with survey responses see names_to_ids()
and
drop_meta()
.
To retrieve a survey's design use design()
. This returns a qualtrics_design
object that many other qsurvey functions can operate on.
d <- design(id = "SV_0CGgkDZJaUvxnGl") print(d)
For example, use questions()
to see the text and other attributes of each
survey question.
svy_q <- questions(design_object = d) svy_q[1:2, ]
See also choices()
, blocks()
, and response_counts()
.
Visualize a survey flow with plot_flow()
. Or for interactive review of a
survey's flow and content in a Shiny app, use render_flow()
.
plot_flow(design_object = d)
See also edges()
and nodes()
.
qualtRics is another R package for working with the Qualtrics API that began around the same time as qsurvey.
qualtricsR focuses on survey creation.
I'm aware of two R packages for earlier versions of the Qualtrics API. Jason Bryer wrote one in 2012. Eric Green forked and revised it for v2.3 of the Qualtrics API, most recently in 2014.
QualtricsTools generates reports from Qualtrics data via Shiny.
Python: PyQualtrics; SurveyHelper.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.