susor_export_file: Starts the export process and downloads files from Survey...

View source: R/susor_export_file.R

susor_export_fileR Documentation

Starts the export process and downloads files from Survey Solution's server.

Description

As for any other function of susor, susor_export_file() requires that you first define your server credentials with susor_login().For susor_export_file() it is required that you define susor_dir_downloads in susor_login(). susor_dir_download is the directory where the file will be unzipped and saved. Pass the questionnaire variable susor_qn_variable, and the version (susor_qn_version) to download susor_export_file() will generate and download that version of the questionnaire.

Usage

susor_export_file(
  susor_qn_variable,
  susor_qn_version,
  susor_format = "STATA",
  susor_interview_status = "All",
  temporary_dir = tempdir(),
  ...
)

Arguments

susor_qn_variable

A string. The variable name of questionnaire (you can find it in the tibble susor_questionnaires that is created by susor_login()).

susor_qn_version

A number. Version number of the questionnaire to download (it can be found in the tibble susor_questionnaires that is created by susor_login()).

susor_format

A string to define the format of the file c("STATA", "Tabular"). Default = "STATA"

susor_interview_status

A string. To define the status of interviews to download c( "All", "SupervisorAssigned", "InterviewerAssigned", "Completed", "RejectedBySupervisor", "ApprovedBySupervisor", "RejectedByHeadquarters", "ApprovedByHeadquarters"). Default = "ALL"

temporary_dir

A temporary directory where the .zip format from the API export response is temporally stored and unzipped from. Default = tempdir().

Value

Unzipped file saved in susor_dir_downloads.

Examples

susor_exportfile(susor_qn_variable = "pupils_SLK"
susor_qn_version = 5)

araupontones/susor documentation built on May 12, 2022, 1:31 p.m.