Skip to contents

This function adds a new column to the data frame that indicates whether a nodal failure event has occurred for each patient. The column name varies by study: - EMBRACE-I: 'event_nodalcontrol_incl_pao' - EMBRACE-II: 'event_nodalfailure'

Usage

add_nodal_failure_event(df)

Arguments

df

A data frame containing: - columns starting with 'disease_nodal_status_' containing numerical values - a 'study' column indicating either 'embrace_i' or 'embrace_ii'

Value

A data frame with an additional column (name depends on study) containing a 1 if a nodal failure event has occurred and 0 otherwise. If all values are NA across all relevant columns for a particular patient, the result will also be NA.

Details

A nodal failure event is defined as an occurrence of value 2 in any nodal status column.

Examples

if (FALSE) { # \dontrun{
test_data <- tibble(
  study = c("embrace_i", "embrace_ii"),
  disease_nodal_status_3m = c(0, 2),
  disease_nodal_status_6m = c(0, 0)
)
result <- add_nodal_failure_event(test_data)
} # }