Skip to contents

[Experimental]

Usage

zhn_read_cohort(path, sheet = NULL, verbose = TRUE)

Arguments

path

Path to the .xlsx file (typically a fileInput() temp path or the bundled example, obtained via zhn_example_path()).

sheet

Optional sheet name to override the canonical/regex resolver.

verbose

Logical; emit a cli_inform when duplicate columns are detected.

Value

A cohort_df S3 object (inheriting from data.frame) with cleaned names, an added integer behandlungsjahr column, and a "sheet_to_use" attribute. Empty input workbooks return a 0-row object.

Details

Reads the primary cohort sheet from a tumour-documentation workbook, cleans column names via janitor::clean_names(), drops trailing empty none* columns, and derives a behandlungsjahr (treatment year) column from the first available date column.

Replaces the legacy read_main_data() from v5 which scanned ~/Desktop for Daten.xlsx. The package never reads ~/Desktop.

Examples

if (interactive()) {
  df <- zhn_read_cohort(zhn_example_path())
  head(df)
}