View source: R/calculate_bmi.R
calculate_bmi | R Documentation |
Uses weight (kg) and height (m) to calculate BMI. Converts from lbs and inches if needed and units are properly supplied.
calculate_bmi(height, weight, height_units = "m", weight_units = "kg")
height |
height in cm, m, or inches |
weight |
weight in lbs or kg |
height_units |
units in "cm", "m", or "inches" |
weight_units |
units as "lbs" or "kg" |
numeric vector containing BMI results
calculate_bmi(height = 1.778, weight = 75)
calculate_bmi(height = 70, weight = 165,
height_units = "inches", weight_units = "lbs")
#incorrect units
calculate_bmi(height = 70, weight = 165,
height_units = "in", weight_units = "lbs")
calculate_bmi(height = c(70, 72, 65),
weight = c(165, 180, 155),
height_units = "inches", weight_units = "lbs")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.