Skip to contents

Derives the treatment year from the first available date column among erstvorstellung, erstdiagnose, therapie_beginn, tumorkonferenz_datum, last_follow_up. If none of these exist, the column is filled with NA.

Usage

.add_year(df)

Arguments

df

A data frame.

Value

The input df with an added integer column behandlungsjahr.

Details

If multiple matching columns exist (e.g. duplicate erstdiagnose columns that janitor::clean_names() renames to erstdiagnose and erstdiagnose_2), the first matching column wins.