surveydetails: Get survey details

Description Usage Arguments Details Value Author(s) References Examples

Description

Get details about a specific survey

Usage

1
2
3
4
5
6
7
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'), ...)

surveypreview(details)

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.

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.

surveypreview opens a survey preview url in a web browser via browseURL.

Value

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

Author(s)

Thomas J. Leeper

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
smlogin()
s <- surveylist()

# retrieve all survey details
d <- surveydetails(s[[1]]$survey_id)
d

# retrieve question wordings
surveyquestions(d)

## End(Not run)

leeper/Rmonkey documentation built on May 21, 2019, 12:36 a.m.