library(tibble)
data <- tribble(
~ATOXDSCL, ~AVAL, ~ANRLO, ~ANRHI, ~PARAM,
"Hypoglycemia", 119, 4, 7, "Glucose (mmol/L)",
"Lymphocyte count decreased", 0.7, 1, 4, "Lymphocytes Abs (10^9/L)",
"Anemia", 129, 120, 180, "Hemoglobin (g/L)",
"White blood cell decreased", 10, 5, 20, "White blood cell (10^9/L)",
"White blood cell decreased", 15, 5, 20, "White blood cell (10^9/L)",
"Anemia", 140, 120, 180, "Hemoglobin (g/L)"
)
derive_var_atoxgr_dir(data,
new_var = ATOXGRL,
tox_description_var = ATOXDSCL,
meta_criteria = atoxgr_criteria_ctcv5,
criteria_direction = "L",
get_unit_expr = extract_unit(PARAM)
)
data <- tribble(
~ATOXDSCH, ~AVAL, ~ANRLO, ~ANRHI, ~PARAM,
"CPK increased", 129, 0, 30, "Creatine Kinase (U/L)",
"Lymphocyte count increased", 4, 1, 4, "Lymphocytes Abs (10^9/L)",
"Lymphocyte count increased", 2, 1, 4, "Lymphocytes Abs (10^9/L)",
"CPK increased", 140, 120, 180, "Creatine Kinase (U/L)"
)
derive_var_atoxgr_dir(data,
new_var = ATOXGRH,
tox_description_var = ATOXDSCH,
meta_criteria = atoxgr_criteria_ctcv5,
criteria_direction = "H",
get_unit_expr = extract_unit(PARAM)
)
Run the code above in your browser using DataLab