This function downloads a survey's response data from Survey Gizmo (SG), saving
the returned data as an R data.frame
. Because SG limits the size of JSON data pulls via the API (currently, the limit is 250),
it calculates the number of pulls needed to download the entire response set and binds the returned frames.
To ensure that variable names are interpretable in the returned data frame, it is strongly recommended
that users first assign question aliases to each question prior to utilizing this function.
1 2 3 4 |
surveyid |
The survey's unique SG ID number (in V4 of the API, the portion of the surveyresponse call URL which follows "id/", e.g.: "...build/id/1234567" |
api |
The user's private API key for Survey Gizmo |
completes_only |
When true (the Default), survey responses with a status of "Complete" are saved. Responses with a status of "disqualified", "partial", etc. are deleted (see this link for documentation) |
verbose |
When true (the default), download progress is printed to standard output. |
var_name_append |
When true (the default), appends the stub "_ID[question_numer] to questions without an alias to avoid variable name conflicts. |
mergecampaign |
When true, contact emails are downloaded from the SG "contact" object and merged with the survey responses. Note: this parameter should only be used with survey projects that have an active email campaign. |
delete_sys_vars |
When true, deletes SG system variables (i.e., fields of the form [[variable(...)]] that do not contain question responses. NOTE: When set to false, pullsg will change the stub of SG system variables to sys_* See this link for more information about fields returned by SG via the API). |
keep_geo_vars |
When true (the default), SG's geographic variables (lat/long, city, etc.), which are estimated using the respondent's IP address, are preserved in the returned data.frame. This option also changes the name of the geographic variables to:
|
clean |
This option performs three transformations to the returned data.frame:
|
reset_row_names |
When true (the default), resets row names to 1, 2,..N in the returned dataframe |
small |
Only merge email address when mergecampaign is true. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.