Code for the yearly TEN SING surveys and the public Quarto site that publishes the results. Two questionnaires run each autumn:
- OG (Ortsgruppen) – one submission per local group (headcounts, activities, staffing).
- TN (Teilnehmende) – individual submissions from participants and staff.
The repo contains both the data pipeline (Kobo pull, cleaning, year-specific tweaks) and the Quarto project that reads the cleaned data.
- R with
renv - Quarto CLI
- Access to the EU KoboToolbox instance
.envwith credentials and survey identifiers
Create .env from .env-template and add one block per survey year:
KOBO_EU_TOKEN="apitoken from kobo instance"
2025_OG="asset id of OG survey"
2025_TN="asset id of TN survey"
2025_OG_URL="public link to OG questionnaire"
2025_TN_URL="public link to OG questionnaire"
Add further <YEAR>_… pairs for every year you process.
see .env-template for example for 2024 and 2025.
renv::restore()Rscript pipeline/run_pipeline.R– runs metadata download, config generation, cleaning, optional year-specific fixes, and OG/TN merging for every year detected underdata/cleaned/<year>/. Create a new emptydata/cleaned/<year>/directory to include another year.- Expected outputs:
config/<year>/og_cfg.rds,config/<year>/tn_cfg.rds,data/cleaned/<year>/og.rds,data/cleaned/<year>/tn.rds, plus raw/metadata CSVs underdata/meta/<year>/anddata/raw/<year>/.
pipeline/setup.R– ensures year-specific directories exist.pipeline/00-get-metadata.R– pulls Kobo survey structure and choice lists.config/og_config.Randconfig/tn_config.R– derive column mappings and URLs.pipeline/01-clean-og-data.R/02-clean-tn-data.R– run _config files, download, clean, reshape, and saveog.rds/tn.rds.pipeline/03-year_specific-processing/process_<year>.R– optional one-off fixes (deduplication, recoding).pipeline/04-tn-og-processing.R– combines OG and TN outputs for region aggregates.
-> pipeline/run_pipeline.R runs the pipeline for all existing years
More details on individual steps in docs/architecture.md.
- All years (pipeline + render):
Rscript build.R- Uses
get_all_years()to loop through years found indata/cleaned/<year>/. - Renders each year with Quarto’s
buildprofile into_site/<year>/(clearing any previous build).
- Uses
- Single year only:
RENDER_YEAR=2025 quarto render . --profile build --output-dir _site/2025- Without
RENDER_YEAR, Quarto uses the most recent year indata/cleaned. quarto render .without--profile buildwrites topreview/for local viewing.
- Without
og.rds:data(one row per OG with regions, headcounts, hours),long(multiselect/matrix tables such aswochentage,unterstuetzungsbedarfe),agg(regional totals).tn.rds:data(cleaned OG names/regions, hours, participation flags),long(e.g.,woerter,zugangsweg,angebote_vor_ort,info_wege_*,kontakt_chrgl),wide(aussagenLikert block),agg(Likert and age summaries),demo(scrambled vectors for safer display).
More details in docs/architecture.md.
pipeline/– end-to-end scripts listed above.config/– metadata-driven question mappings, visual settings (viz_config.R), per-year cfg RDS files.data/–meta/,raw/,cleaned/per year; region and OG recoding CSVs.R/– shared helpers for both pipeline and Quarto (load_libs.R,load_data.R,utils.R,quarto-utils.R,viz.R).*.qmd– Quarto pages;_region-template*.qmdpower the region subpages;_quarto.ymlconfigures the site.
More details in docs/architecture.md.
See LICENCE.md.