Derive "Tier 0" variables before any marker function runs.
Source:R/utils_helpers.R
dot-hm_global_precompute.RdComputes the following variables only when they are absent from data:
- BMI
from
weight(kg) andheight(m or cm) viaweight / height_m^2- glucose / G0
bidirectional alias: whichever is absent is filled from the other
- insulin / I0
bidirectional alias (pmol/L <-> muU/mL unchanged – same unit assumed)
- eGFR
CKD-EPI 2009 creatinine equation from
creatinine,age,sex(and optionallyrace). Written aseGFRonly; downstream functions that needeGFR_crreceive it via col_map.- UACR
urine_albumin/urine_creatinine(both in mg/mmol or the ratio already in mg/g – no unit conversion; caller's responsibility)- LDL_c
Friedewald:
TC - HDL_c - TG/2.2(mmol/L); skipped if TG > 4.5
Value
A list:
- data
data.frame with new columns appended.
- precomputed
Character vector of variable names that were derived.
Details
col_map keys are respected: if the user has mapped e.g.\ creatinine -> "Cr_serum",
the materialized data[["creatinine"]] column (placed there by .hm_build_col_map())
is used transparently.