2024-11-18

Introduction

Body Mass Index (BMI) Calculator designed to help users assess their health by providing an easy-to-use interface for calculating BMI and receiving personalized health recommendations.

BMI Information

  • It categorizes individuals as underweight, normal weight, overweight, obese. Important for health assessment, preventive care, healthy lifestyle.

How It Works

  1. Input: Users enter their weight and height.
  2. Calculation: The app calculates BMI using the formula:
    \[ BMI = \frac{weight(kg)}{(height(m))^2} \]
  3. Output: BMI value and health status are displayed interactively.

R Code: BMI Calculation and Category

weight <- 70
height <- 170 / 100
bmi <- weight / (height^2)
bmi
## [1] 24.22145
if (bmi < 18.5) {
  category <- "Underweight"
} else if (bmi < 25) {
  category <- "Normal weight"
} else if (bmi < 30) {
  category <- "Overweight"
} else {
  category <- "Obese"
}
category
## [1] "Normal weight"

Try It Now!