Last chance! 50% off unlimited learning
Sale ends in
getresponses(respondents, survey, api_key = getOption('sm_api_key'), oauth_token = getOption('sm_oauth_token'), ...)
getallresponses(survey, api_key, oauth_token, wait = 0, ...)
respondentlist
.surveylist
.getOption('sm_api_key')
.smlogin
. By default, retrieved from getOption('sm_oauth_token')
.POST
.getresponses()
, a list (of class sm_response_list
) containing one or more objects of class sm_response
.For getallresponses()
, a data.frame.
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.
## Not run:
# smlogin()
# s <- surveylist()
# r <- respondentlist(s[[1]])
#
# # get one response
# getresponses(r[[1]], s[[1]])
#
# # get all responses (up to 100)
# g <- getresponses(r, s[[1]])
# as.data.frame(g) # convert to data.frame
# ## End(Not run)
Run the code above in your browser using DataLab