# NOT RUN {
# Register your Qualtrics credentials if you haven't already
registerOptions(api_token="<YOUR-API-TOKEN>", root_url="<YOUR-ROOT-URL>")
# Retrieve a list of surveys
surveys <- getSurveys()
# Retrieve a single survey
mysurvey <- getSurvey(surveyID = surveys$id[6],
save_dir = tempdir(),
verbose=TRUE)
# You can use the same parameters as those found in the qualtrics API documentation
# Found here: https://api.qualtrics.com/docs/csv
mysurvey <- getSurvey(surveyID = surveys$id[6],
save_dir = tempdir(),
startDate = "2017-01-01",
endDate = "2017-01-31",
limit = 100,
useLabels = TRUE,
seenUnansweredRecode = "UNANS",
verbose=TRUE)
# You can also choose to only download an export with specific questions using
# the \code{\link[getSurveyQuestions]{getSurveyQuestions}} function.
# Retrieve questions for a survey
questions <- getSurveyQuestions(surveyID = surveys$id[6])
# Retrieve a single survey, filtering for questions I want.
mysurvey <- getSurvey(surveyID = surveys$id[6],
save_dir = tempdir(),
includedQuestionIds = c("QID1", "QID2", "QID3"),
verbose=TRUE)
# }
Run the code above in your browser using DataLab