BMI Calculator

Vishakha Mujoo
23 Jan 2014

BODY MASS INDEX

The body mass index (BMI), or Quetelet index, is a measure of relative size based on the mass and height of an individual.

The index was devised by Adolphe Quetelet during the course of developing what he called “social physics”, between 1830 and 1850.[2] The BMI for a person is defined as their body mass divided by the square of their height-with the value universally being given in units of kg/m2. So if the weight is in kilograms and the height in metres, the result is immediate, if pounds and inches are used, a conversion factor of 703 (kg/m2)/(lb/in2) must be applied.

SOURCE : WIKIPEDIA

Application Code

End user provides three inputs and based on that BMI is calculated

METRIC   = 1;
IMPERIAL = 2;

bmi <- function(mass, height, units) {
      bmi = mass / height^2

      if (units == IMPERIAL) {
            bmi = bmi * 703
      }

      return (bmi)
}

Application Link

For example, if the subject is 2 meters tall and weights 80 kg, his BMI is 20 and his fitness level might be addressed by the following function call which is normal healthy weight

# Testing BMI
bmi(80,2,METRIC)
[1] 20

Link to Actual Application https://mujoo.shinyapps.io/dataproducts/

Conclusion

The BMI is used in a wide variety of contexts as a simple method to assess how much an individual's body weight departs from what is normal or desirable for a person of his or her height.

The index is the simpliest way to estimate the overall fitness condition of the particular person. However, lots of other physical and biological parameters (such as genetic background, sugar in blood, age etc.) must be taken into account to give a more accurate evaluation of the preson's fitness and health.