Convert MUAC values to either centimeters or millimeters as required. Before to covert, the function checks if the supplied MUAC values are in the opposite unit of the intended conversion. If not, execution stops and an error message is returned.
Usage
recode_muac(x, .to = c("cm", "mm"))
Arguments
- x
A vector of the raw MUAC values. The class can either be
double
ornumeric
orinteger
. If different than expected, the function will stop execution and return an error message indicating the type of mismatch.- .to
A choice between
cm
(centimeters) andmm
(millimeters) for the measuring unit to convert MUAC values to. Before to execute the conversion, the function checks if values are in the opposite unit; in case not, the execution stops and an error message is returned. Strive to address the error and try again.