This repository contains code for the annual TEN SING survey.
Each autumn, TEN SING Germany conducts two surveys among its members:
- a survey among its local groups. Each local group answers once and reports data on the local level (e.g. number of events, participants) (de: Ortsgruppen -> prefix "og" in this repo).
- a survey among its members. each member can report on their experience, preferences, wishes, etc. (de: Teilnehmende -> prefix "tn" in this repo)
The surveys are conducted using the open source tool KoboToolbox, more specifically the EU instance.
So far, the survey has only been conducted in 2024, but the second wave is being rolled out in early October 2025.
Package management is done with renv
. To restore necessary packages:
renv::restore()
To interact with KoboToolbox API for data processing, you need an API token and access to the surveys. Create an account on the EU instance and contact CorrelAid to get access.
Refer to the .env-template
This repository contains code for:
- data processing and data wranglig
- and the static HTML report/website
To understand the data processing, it is important to understand that KoboToolbox uses the xlsform format which represents metadata of surveys/forms in an excel sheet. Consequences of this:
- one question can have multiple columns
- columns have very specific naming patterns, e.g. using various levels of prefixes to group columns together (e.g. for question matrixes). This is particularly relevant for question matrixes.
- not all columns contain actual response data, some only contain introductory text or other metadata.
- execute scripts in
pipeline
in order - or using
make
(seeMakefile
)
make data
data processing is separated in several R scripts which are in the folder pipeline
. Abstractly, the pipeline does the following:
Get data from Kobo
- get metadata for the two surveys
- get data for local group (
og
) survey - get data for member (
tn
) survey
The purpose and working of each script is explained in more detail in its header.
We use the kbtbr package for interacting with the KoboToolbox API.
cleanup
- recoding of open answers to "what is your local group called?" question. this was only done in 2024, from 2025 onwards this will be a single-select question.
- deletion of duplicate answers to the local group survey
The purpose and working of each script is explained in more detail in its header.
configuration related to data processing:
config/og_config.R
config/tn_config.R
Those files contain "configuration" to identify the acutal column(s) for each question. This is done to avoid hardcoding those column names in the data processing pipeline.
The purpose and workings of each script is explained in more detail in its header.
R/utils.R
contains functions related to data processing.- relevant for
config/*
:find_q
andfind_qs
to identify the columns - relevant for
pipeline
scriptsget_[tn|og]_data
:make_multiselect_long
andpivot_cols_long
- relevant for
The report is a quarto website. It contains several pages.
Tools:
ggplot
: plotsggiraph
: make ggplots interactivereactable
: for tables
Development server:
quarto preview
Build the website -> outputs to _site
quarto render
or using make (see Makefile
):
make website
- configuration of website in
_quarto.yml
. R/quarto-utils.R
: utility functions (e.g. extracting question text for a question, formatting text)R/viz-utils.R
: functions for recurring plots
- question on local group name is now a single select (previously open text)
- better metadata labels for blocks (now "speaking" question groups)
- some minor changes to options
- fixed type bug where number of people was text field instead of integer/numeric entry