Learn R Programming

PAutilities (version 1.1.0)

get_bmi: 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") )

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).

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

Examples

Run this code
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))

Run the code above in your browser using DataLab