Skip to contents

Deutsch · English · Website (German)

R-CMD-check License: MIT

R package for personalised survey reports, in particular course evaluations and surveys of students and graduates. One line of code per question produces the heading, table and chart for a Quarto report (PDF via Typst). A report table and a rules table turn a single template into many reports with different content, e.g. one per department or degree programme.

The package, its documentation and the generated reports are in German.

Rating scale items: table of statistics and box plots per item, followed by the overall gradeMultiple-choice question with table and bar chart, followed by a rating scale item with its distribution

Features

  • Import from evasys: evasys_read_data() reads raw data and codebook and attaches question text, question number, question type and value labels to every variable.
  • One function per question type: single choice, multiple choice, rating scales, groups of rating scale items, numbers, semester of study, grades, workload, response rate and open questions – each with consistently styled tables and charts. merge_many() analyses whole blocks of questions at once.
  • Many reports from one template: input_tabelle() uses a report table and a rules table (Excel) to decide which questions appear in which report.
  • Open answers in an appendix: identical answers are combined, links lead from the question to the appendix and back.
  • Consistent look: accent colour, column widths and defaults are set in one place with change_analysis_defaults(); the font “Red Hat Text” is bundled for the charts.

Installation

# install.packages("pak")
pak::pak("donvollb/setanalysis")

The reports also require Quarto (≥ 1.7, includes Typst) and the font Red Hat Text.

Quick start

The analysis functions write Markdown or Typst to the output, so they are called in R chunks with output: asis:

---
title: "Lehrveranstaltungsevaluation"
format: typst
---

```{r}
#| include: false
library(setanalysis)
daten <- BspDaten$dataLVE # own data: evasys_read_data("rohdaten.csv", "codebuch.csv")
```

```{r}
#| output: asis
merge_aggr_sk(daten[, c("KF_01", "KF_02", "KF_03")], kennung = daten$Kennung, aggr = TRUE)
merge_grade(daten$Note, daten$Kennung)
merge_sc(daten$V3_D)
```

In RStudio, a single analysis can be previewed without rendering: markdown_in_viewer(merge_sc(BspDaten$dataLVE$V3_D)).

Typical workflow

  1. Read the data with evasys_read_data() (or add the attributes label, nr, type and labels to your own data).
  2. Define the reports (for several reports with different content): a report table with one row per report and a rules table with one condition per question; input_tabelle() computes the switches inkl.<section>.<question> and header<section>.
  3. Write the report in Quarto: one analysis function per question, e.g. merge_sc(x, nr = "1.3"). With nr, the function checks the switch inkl.1.3 and only appears in the matching reports. appendix_open() at the end prints the collected open answers.
  4. Render all reports, e.g. with quarto::quarto_render() in a loop over the rows of the report table.

The vignette Einen Evaluationsbericht erstellen walks through all steps (in German). All help pages are in the function reference; in R, ?setanalysis gives an overview.

A complete report template with layout (header and footer, table of contents, accent colour) and two working examples is set-template.

Example data

BspDaten contains fictional, randomly generated data from a course evaluation and a first-year student survey in the format of evasys_read_data(). Example files for evasys_read_data() and input_tabelle() are in system.file("extdata", package = "setanalysis").

Development

The behaviour of all functions is covered by snapshot tests (testthat) that compare the generated report building blocks, including the charts (SVG). The scripts that generate the example data and preview images are in data-raw/. Changes are listed in the changelog (German). How to maintain the package (branches, tests, GitHub Actions, releases) is described in the article Das Paket pflegen (German).

Authors and licence

Dominik Vollbracht and Simon Männle · MIT License