Loads data from EMBRACE-II website exports, processes them, and joins them by the `embrace_id` column. The function handles multiple data sheets including patient information, registration, diagnosis status, baseline morbidity, treatment data, and vital status.
Usage
load_embrace_ii(
file_path = here::here("data_raw/embrace_II/emii.xlsx"),
file_path_eqd2 = here::here("data_raw/embrace_II/emii_eqd2.xlsx"),
add_new_columns = TRUE,
mapping_file = here::here("data_raw/mapping_table/mapping_table.xlsx"),
include_only_study_patients = TRUE,
replace_minusone_with_na = TRUE
)
Arguments
- file_path
Character, path to the directory containing the primary data files
- file_path_eqd2
Character, path to the EMBRACE-II EQD2 Excel file
- add_new_columns
Logical, if TRUE, calculate and add derived columns (default: TRUE)
- mapping_file
Character, path to the column mapping table file
- include_only_study_patients
Logical, if TRUE, only return patients included in the study (default: TRUE)
- replace_minusone_with_na
Logical, if TRUE, replace -1 values with NA (default: TRUE)
Examples
if (FALSE) { # \dontrun{
# Load with default settings
df <- load_embrace_ii()
# Load all patients, including those excluded from the study
df <- load_embrace_ii(include_only_study_patients = FALSE)
# Load with custom file paths
df <- load_embrace_ii(
file_path = "path/to/emii.xlsx",
file_path_eqd2 = "path/to/emii_eqd2.xlsx"
)
} # }