After all the data has been washed, the chapter overview has been created, and any adjustments to the templates in 02_resources
have been made, we can finally create a draft report!
It is natural to set up an RStudio Project (*.Rproj) for the Saros folder that remembers unsaved R files, some personal preferences for the project, etc. But avoid saving the working memory (Environment) to disk (.Rdata) , so that functionality can be turned off in Project options… The reason is that over time there can be many large objects, and as much as possible should be able to be run from scratch when you need it.
Given that everything is set up correctly, there are really only 2-3 syntax files you will need to work with each implementation.
000_initialize_project.R
: Establishes global paths, and lists to be populated with datasets, etc for each year. The system is set up so that you can easily handle several years (implementations) without accidentally overwriting each other. You are actually guaranteed that the spring of 2024 will always be the spring of 2024 when you loop over several years - given that the data sets are stored in the correct folders.001_configure_report.R
: This file is, in a way, the main file from which you control most things. From this, you can select a cohort/implementation you want to run, or loop over several at the same time (even several respondent groups, such as in the Participant surveys). The first loop is meant to be run to generate drafts. Further down are ready-made scripts to compile the web pages/PDF files, as well as generate access protection and issue password access to institutions.002_specify_report_cycle_params_for_{CYCLE}.R
: Little used so far. Used as storage of year-specific information that can be used to fill in the report’s fixed points, such as report number, the survey’s opening period, etc.003_get_report_cycle_paths.R
: Here you should rarely need to change anything, as long as there are no odd exceptions a year.200_prep_data_for_{CYCLE}.R
: You can choose whether you want to do all washing of post-data collection data outside the Saros process, or inside.
If you want to do all the data washing before Saros is involved (for example, that it is done by a Stata user), you should still keep this R script to read in the actual variable labels from the raw data again, as Stata and SPSS cut off variables - labels. In addition, you discover a number of things when you are running saros, which are easiest to fix in this script. Typically this applies to variable labels and similar “aesthetics”.
If you want to do everything in the Saros process, it may be natural to divide the data preparation into several scripts and put in a subfolder for the given year/implementation so that you keep order (must then update in the get_paths script).
draft_saros_reports.R
: Here the chapter overview and settings in _report_generation_setup.yaml
are obtained (which can be overridden for a specific implementation, or for just the mesos reports).render_and_publish.R
: In this script everything is moved from the folder with finished drafts to a temporary folder (temp). The latter folder should not be located on OneDrive/cloud solution/Sharepoint as there are many files that are copied and created which run slowly when OneDrive has to synchronize along the way. BUT MORE IMPORTANTLY, SHAREPOINT HAS A LIMITATION ON THE NUMBER OF CHARACTERS IN THE PATHS WHICH CAUSES FILES SUDDENLY NOT TO BE FOUND AND GIVES WEIRD ERROR MESSAGES.email_credentials.R
: This is for mesos reports only. With an overview of e-mail information for contact persons at the institutions who will each have their own report, they can be sent usernames/passwords. Set send_emails <- FALSE
to only create drafts in your Outlook folder for this. Set as `TRUE’ to actually send out immediately (does not affect any drafts you may have already created in your Outlook folder).