Set a value where the actual value of a measurement is less than the method detection limit (MDL)
set_non_detects(
value,
mdl_flag = NULL,
mdl_value = NULL,
mdl_action = c("zero", "mdl", "half", "na")
)
a numeric vector of measured values
a character vector the same length as value
that has a
"flag" (assumed to be "<"
) for values that are below the MDL
a numeric vector the same length as value
that contains
the MDL values.
What to do with values below the detection limit. Options
are "zero"
(set the value to 0
; the default), #' "half"
(set the value
to half the MDL), "mdl"
(set the value to equal to the MDL), or "na"
(set
the value to NA
).
a numeric vector the same length as value with non-detects adjusted accordingly
You must supply either mdl_flag
or mdl_value
, or both. When only
mdl_flag
is supplied, it is assumed that the original value
has been
set to the MDL, and will be adjusted according to the mdl_action
. When
only mdl_value
is supplied then any value
less than that will be
adjusted appropriately using the corresponding mdl_value
. When both
mdl_flag
and mdl_value
are supplied, any value
with a corresponding
<
in the mdl_flag
vector will be adjusted appropriately using the
corresponding mdl_value
.