Get maximum side effect values and corresponding timepoints and export to Excel with conditional formatting
Source:R/add_latest_side_effects.R
get_max_side_effects.Rd
Get maximum side effect values and corresponding timepoints and export to Excel with conditional formatting
Usage
get_max_side_effects(
df,
endpoints,
max_grade = 0,
export_to_excel = FALSE,
file_name = "max_side_effects.xlsx"
)
Arguments
- df
A data frame containing side effect columns with multiple timepoints and a patient ID column "embrace_id".
- endpoints
A character vector of endpoint basenames (e.g., from embraceR::clean_side_effect_names()).
- max_grade
Numeric threshold; only patients with at least one max_value >= max_grade will be retained.
- export_to_excel
Logical; if TRUE, exports the result to an Excel file.
- file_name
Character; the name of the Excel file to export if export_to_excel is TRUE.