get_bmi: Calculate body mass index

View source: R/get_bmi.R

get_bmiR Documentation

Calculate body mass index

Description

Calculate body mass index

Usage

get_bmi(
  wt,
  wt_unit = c("kg", "lb", "oz", "st"),
  ht,
  ht_unit = c("cm", "m", "in", "ft"),
  target = NULL
)

get_wt_kg(wt, wt_unit = c("kg", "lb", "oz", "st"))

get_ht_m2(ht, ht_unit = c("cm", "m", "in", "ft"))

bmi_check(bmi)

target_wt(
  target,
  ht,
  ht_unit = c("cm", "m", "in", "ft"),
  wt_unit = c("kg", "lb", "oz", "st")
)

Arguments

wt

body mass

wt_unit

character. Units of body mass (or desired units if target is passed. See below.)

ht

height

ht_unit

character. Units of height

target

an optional target BMI (kg/m^2), for which the corresponding body mass will be returned

bmi

internal argument

Value

If target is NULL (default), the function returns the body mass index. If target is provided, the function will use target and ht to back-calculate a target body mass in the units defined by wt_unit (kg by default).

Examples

get_bmi(160, "lb", 180, "cm")
get_bmi(ht = 5.90, ht_unit = "ft", target = 24, wt_unit = "st")
get_bmi(wt = c(60:79, NA), ht = c(NA, 160:179))

PAutilities documentation built on Aug. 21, 2022, 9:05 a.m.