Skip to contents

Computes:

  • sweat_chloride (mmol/L)

  • Na_K_ratio (sweat Na+/K+)

  • sweat_lactate (mmol/L)

  • sweat_rate (L/m^2/h) from body mass loss per hour per m^2

Usage

sweat_markers(
  data,
  col_map = list(sweat_chloride = "sweat_chloride", sweat_Na = "sweat_Na", sweat_K =
    "sweat_K", sweat_lactate = "sweat_lactate", weight_before = "weight_before",
    weight_after = "weight_after", duration = "duration", body_surface_area =
    "body_surface_area"),
  verbose = FALSE,
  na_action = c("keep", "omit", "error"),
  na_warn_prop = 0.2,
  check_extreme = FALSE,
  extreme_action = c("warn", "cap", "error", "ignore"),
  extreme_rules = NULL
)

Arguments

data

A data.frame or tibble containing sweat assay and anthropometrics.

col_map

Named list mapping required inputs (defaults assume same names):

  • sweat_chloride, sweat_Na, sweat_K, sweat_lactate, weight_before, weight_after, duration, body_surface_area

verbose

Logical; if TRUE, prints progress messages and a completion summary.

na_action

One of c("keep","omit","error") for handling missing values in required inputs. Default "keep".

na_warn_prop

Proportion \([0,1]\) to trigger high-missingness diagnostics for required inputs (debug level). Default 0.2.

check_extreme

Logical; if TRUE, scan inputs for extreme values. Default FALSE.

extreme_action

One of c("warn","cap","error","ignore") when extremes detected. Default "warn".

extreme_rules

Optional named list of c(min,max) bounds for inputs. If NULL, broad defaults are used.

Value

A tibble with columns: sweat_chloride, Na_K_ratio, sweat_lactate, sweat_rate

Details

Inputs are validated, missingness handled via na_action, safe divisions are used to avoid Inf/NaN, and an optional extremes scan/cap is available.

Expected units:

  • sweat_chloride, sweat_Na, sweat_K: mmol/L

  • sweat_lactate: mmol/L

  • weight_before, weight_after: kg

  • duration: hours

  • body_surface_area: m^2

References

Gibson LE, Cooke RE. A test for concentration of electrolytes in sweat in cystic fibrosis of the pancreas utilizing pilocarpine by iontophoresis. Pediatrics. 1959;23(3):545-549. (Sweat chloride test origin) Dill DB, Costill DL. Calculation of percentage changes in volumes of blood, plasma, and red cells in dehydration. J Appl Physiol. 1974;37(2):247-248. doi:10.1152/jappl.1974.37.2.247 Farrell PM, White TB, Ren CL, et al. Diagnosis of cystic fibrosis: consensus guidelines from the Cystic Fibrosis Foundation. J Pediatr. 2017;181S:S4-S15.e1. doi:10.1016/j.jpeds.2016.09.064 Sawka MN, Cheuvront SN, Kenefick RW. Hypohydration and human performance: impact of environment and physiological mechanisms. Sports Med. 2015;45(Suppl 1):S51-S60. doi:10.1007/s40279-015-0395-7

Examples

df <- tibble::tibble(
  sweat_chloride    = 45,
  sweat_Na          = 55,
  sweat_K           = 5,
  sweat_lactate     = 4.8,
  weight_before     = 70.0,
  weight_after      = 69.5,
  duration          = 1.0,
  body_surface_area = 1.9
)
sweat_markers(df)
#> # A tibble: 1 × 4
#>   sweat_chloride Na_K_ratio sweat_lactate sweat_rate
#>            <dbl>      <dbl>         <dbl>      <dbl>
#> 1             45         11           4.8      0.263