View source: R/suso_api_export_files.R
suso_export | R Documentation |
Generates and downloads the data from your Survey Solutions server.
suso_export(
server = suso_get_api_key("susoServer"),
apiUser = suso_get_api_key("susoUser"),
apiPass = suso_get_api_key("susoPass"),
workspace = NULL,
token = NULL,
questID = "",
version = 1,
workStatus = "Completed",
reloadTimeDiff = 1,
inShinyApp = F,
n_id_vars = 11
)
server |
Survey Solutions server address |
apiUser |
Survey Solutions API user |
apiPass |
Survey Solutions API password |
workspace |
server workspace, if nothing provided, defaults to primary |
token |
If Survey Solutions server token is provided apiUser and apiPass will be ignored |
questID |
Questionnaire ID |
version |
Questionnaire version |
workStatus |
define which statuses the file should inlude (i.e. Restored,Created,SupervisorAssigned,InterviewerAssigned, RejectedBySupervisor,ReadyForInterview, SentToCapi,Restarted,Completed,ApprovedBySupervisor, RejectedByHeadquarters,ApprovedByHeadquarters,Deleted), if NULL all is exported |
reloadTimeDiff |
time difference in hours between last generated file and now |
inShinyApp |
if True, file interacts with shiny progress bar |
n_id_vars |
specify the number of identification variables (not used for now!) |
This API call uses the STATA export format to retrieve the categorical variables and labels.The result has the following characteristics:
it is returned as a LIST with up to 4 different lists. The list names are:
main Contains the top level data, and (if available interviewer comments)
R1 All rosters in roster level 1
R2 All rosters in roster level 2
R3 All rosters in roster level 3
Number of lists depends on the level of roster nesting
All variable names are transformed to lower case and categorical variables are consistently labeled
Consistent id variables are generated with
interview__id transformed to id
parent ids consistently number starting from id (questionnairid) to idX (maximum id3)
List elements are returned as data.tables
Allows for specification of reload time (i.e. generation of new download file)
PRESERVES categorical labels and values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.