Welcome to Calculate Your Health App!

created by violetgirl
Sat Dec 26 21:08:47 2015

What the App is about?

  • Do you want to know what is your health status?
  • Do you need to diet?
  • Do you need to exercise?

Check out the App to get answer to these questions!

How to run the App (Instructions):

  • First, you need to know your height in any unit system.
  • Second, you need to know your weight in any unit system.
  • Enter the measurements and click the corresponding units.
  • You can mix the units you are using. For example, your height can be in meters and your weight can be in pounds. The App will automatically convert inches in meters and pounds in killograms.
  • Press the Submit button.

Lets consider the default values used in the App:

  • height = 1.80 meters
  • weight = 75.0 kilograms
  weight = 75.0
  height = 1.80
  bmi=weight/(height*height)
  bmi
[1] 23.14815
healthStatus(bmi)
[1] "keep going with the balanced diet and exercise!"

Lets consider another App example:

  • height = 1.65 meters
  • weight = 200 pounds (weight will be converted automatically in the App to the killograms)
  weight = 200*0.454
  height = 1.65
  bmi=weight/(height*height)
  bmi
[1] 33.3517
  healthStatus(bmi)
[1] "see the doctor immediately, you are at your health risk!"

The healthStatus function definition

healthStatus <- function(bmi){
  if (bmi < 18.5) 
    status="see the doctor immediately, you are underweight!" 
  else if (bmi > 18.5 & bmi < 24.9) 
    status="keep going with the balanced diet and exercise!"
  else if (bmi > 25 & bmi < 29.9) 
    status="consult about the balanced diet and exercise!"
  else if (bmi > 30) 
    status="see the doctor immediately, you are at your health risk!"
  return (status) }