BMI Calculator

Deniz

2023-12-05

Overview

BMI calculator is a very simple shiny app that calculates Body Mass Index (BMI)

This application is developed for the Developing Data Products course using Shiny.

Source code is in two files: ui.R and server.R

ui.R contains user interface related elements and in server.R backend calculations are done.

Input values

The input values to calculate the BMI are:

  • Weight in kg
  • Height in cm

Calculation

The BMI is calculated in the server.R file using the formula weight/height (in m) ^2 . Below is a sample calculation.

weight = 50
height = 170
BMI <- function(w, h) w / (h/100)^2
BMI(weight,height)
[1] 17.30104