Description Usage Arguments Details Value Author(s) References Examples
Get responses for a survey
1 2 3 4 5 | getresponses(respondents, survey,
api_key = getOption('sm_api_key'),
oauth_token = getOption('sm_oauth_token'), ...)
getallresponses(survey, api_key, oauth_token, wait = 0, ...)
|
respondents |
A vector containing up to 100 respondent ID numbers, possibly returned by |
survey |
A Survey Monkey survey ID number (or an object of class “sm_survey” from which it can be extracted), possibly returned by |
api_key |
Your API key. By default, retrieved from |
oauth_token |
Your OAuth 2.0 token, as generated by |
wait |
A time, in seconds, to wait between API calls. This can be used to throttle API request in order to avoid going over limits. |
... |
Other arguments passed to |
Retrieves response data for requested respondents to a specified survey. getresponses()
retrieves a list structure that can be further parsed using an as.data.frame
method. getallresponses()
returns a data.frame of all responses for a survey automatically using just the survey ID.
Note: Text responses returned are truncated after 32,768 characters.
Note: Surveys with over 500,000 responses are not available via the API currently.
For getresponses()
, a list (of class sm_response_list
) containing one or more objects of class sm_response
.
For getallresponses()
, a data.frame.
Thomas J. Leeper
https://developer.surveymonkey.com/mashery/get_responses
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
smlogin()
s <- surveylist()
r <- respondentlist(s[[1]])
# get one response
getresponses(r[[1]])
# get all responses (up to 100)
g <- getresponses(r)
as.data.frame(g) # convert to data.frame
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.