susor
is work in process and does not intend to substitute any official documentation, software, or other packages.
The main reason of its existence is that after having worked on several household surveys using
Survey Solutions I realized that I was always copy and pasting old code to repeat similar or identical processes.
The main motivation is to develop a package that facilitates the work of the future me. So, the future me can continue improving and growing the code. Nevertheless, it would be great if others feel that susor
is useful for their needs. Please feel free to use it but be aware that I am not responsible for any bug or for its incorrect use.
Also, feel free to collaborate on making susor
easier and more efficient to use.
susor
does the following:susor_login()
,susor_login()
or with susor_get_questionnaires()
,susor_export_file()
, andsusor_append_versions()
susor_approve_hq()
susor_post_interviewers()
Each of the above functions is documented.
susor
is like thisALWAYS START BY DEFINING YOUR API CREDENTIALS WITH susor_login()
. All the other functions won't work without this. You must call susor_login()
once you start R or everytime you empty your global environment. You must specify all the paramenters within susor_login()
, including susor_dir_downloads
and susor_dir_raw
. You'll use them later.
Look at the tibble susor_questionnaires
that was generated by susor_login()
.In this tibble you'll find all the parameters to generate and download files with susor_export_file()
.
Pass the questionnaire variable and version susor_qn_variable
and susor_qn_version
to susor_export_file()
, the result of this will be a folder with the unzipped version of that file in the directory (susor_dir_download
) that you defined in step 1.
Pass susor_qn_variable
to susor_append_versions()
to append all the versions of the same questionnaire.
A directory with the appended file(s) will be saved in susor_dir_raw
. The default of this function will fetch key variables from interviewdiagnostics and interviewactions. You can turn this off by setting get_diagnostics == FALSE
. (see ?susor_append_versions
)
After having checked the quality of each interview, pass a vector susor_interview_key
to susor_approve_hq()
to approve these interviews in the server.
Other useful functions from susor
:
susor_get_diagnostics()
gets the variables from interviewdiagnostics and the last action from interviewactions. It also creates a variable called link that is the url to the interview in the server (useful for QAing). See ?susor_get_diagnostics
*susor_get_assignments()
returns a tible with the details of the assignment by questionnaire and version
susor_get_interviewers()
returns a tibble with the list of interviewers in a specific supervisor team
susor_post_interviewers()
updates list of interviewers in the server
```{r eval=FALSE}
devtools::install_github("araupontones/susor") library(susor)
library(glue) library(httr) library(jsonlite) library(lubridate) library(rio) library(tidyverse)
survey_dir = "C:/Users/MARADONA/Dropbox/survey/Data Management"
susor_login(susor_server = "http://my.golsurveys.com", susor_user = "maradona", susor_password = "pelusa123", susor_dir_downloads = file.path(survey_dir, "downloads"), susor_dir_raw = file.path(survey_dir, "raw")
)
susor_export_file(susor_qn_variable = "best_goals", susor_qn_version = 2)
susor_export_file(susor_qn_variable = "best_goals", susor_qn_version = 3)
susor_append_versions(susor_qn_variable = "best_goals", susor_format = "STATA" )
df_raw = import(file.path(susor_dir_raw, "best_goals.dta")
to_approve <- c("00-06-27-10","00-78-23-02" )
susor_approve_hq(susor_interview_key = to_approve, by = "interview__key", susor_data_reference = raw )
```
I am working on functions to ease the use of interviewdiagnostics and interviewactions so they can be included in the regular checks during a data collection
The link and chart below were used to develop the code that interacts with the server via the API. Both were obtained from the support site of Survey Solutions: Survey Solutions API
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.