Learn R Programming

Rmonkey (version 0.3.1)

surveydetails: Get survey details

Description

Get details about a specific survey

Usage

surveydetails(survey, api_key = getOption('sm_api_key'), oauth_token = getOption('sm_oauth_token'), ...)
surveyquestions(survey, details, api_key = getOption('sm_api_key'), oauth_token = getOption('sm_oauth_token'), ...)

Arguments

survey
A Survey Monkey survey ID number (or an object of class “sm_survey” from which it can be extracted), possibly returned by surveylist. For surveyquestions, either survey or details must be supplied.
details
For surveyquestions, either survey or details must be supplied. details must be supplied as an object of class sm_surveydetails. If missing, a surveydetails request will be executed for the survey supplied in the survey argument.
api_key
Your API key. By default, retrieved from getOption('sm_api_key').
oauth_token
Your OAuth 2.0 token, as generated by smlogin. By default, retrieved from getOption('sm_oauth_token').
...
Other arguments passed to POST.

Value

surveydetails, a list of objects of class sm_survey. For surveyquestions, a character vector with Survey Monkey question ID values as names.

Details

surveydetails retrieves details of a specified survey (e.g., question metadata). Surveys with over 200 survey pages will not be returned. Surveys with over 200 questions will not be returned.

surveyquestions extracts a named character vector of question wordings from a “sm_surveydetails” object. This can be useful for creating a codebook of responses or for mapping responses (from getresponses) to the original question wordings.

References

https://developer.surveymonkey.com/mashery/get_survey_details

Examples

Run this code
## Not run: 
# smlogin()
# s <- surveylist()
# 
# # retrieve all survey details
# d <- surveydetails(s[[1]]$survey_id)
# d
# 
# # retrieve question wordings
# surveyquestions(d)
# ## End(Not run)

Run the code above in your browser using DataLab