This function adds a new column to the dataframe that indicates whether a local failure event
has occurred for each patient. A local failure event is defined as an occurrence of the value 2
in any of the 'overall_disease_local_recurrence_' columns.
Usage
add_local_failure_event(df)
Arguments
- df
A data frame containing at least one column starting with 'overall_disease_local_recurrence_'.
These columns should contain numerical values where 2 indicates a local failure event.
Value
A data frame with an additional column named 'event_localfailure'. This column contains
a 1 if a local failure event has occurred and a 0 otherwise.
Examples
if (FALSE) { # \dontrun{
# Example DataFrame (df)
# overall_disease_local_recurrence_3m overall_disease_local_recurrence_6m
# 0 2
# 0 0
# 2 0
# df <- add_local_failure_event(df)
} # }