Skip to contents

Apply physiologic bounds to a data frame

Usage

filter_bounds(
  data,
  bounds = NULL,
  population = c("adult", "pediatric", "neonatal"),
  action = c("nullify", "clip", "drop", "winsorize", "flag_indicator"),
  feature_col = NULL,
  value_col = "value_as_number"
)

Arguments

data

Wide data frame (one column per feature) when feature_col is NULL; otherwise a long frame with feature_col naming the feature and value_col the value.

bounds

NULL = default bounds for population; a named list overrides per feature (list(wbc = c(0.5, 150))); FALSE disables filtering. Inclusive; NA end = open.

population

Target population ("adult", "pediatric", or "neonatal").

action

"nullify" (out-of-range -> NA; default), "clip" or "drop".

feature_col, value_col

See data.

Value

The data frame with attribute bounds_report (feature, low, high, n_checked, n_out_of_range).