2023-11-14

Introduction

Body Mass Index (BMI), is a simple method of measuring the body fat of an individual from their height and weight. It, while not always the best, is an accepted measure of checking whether or not a person has a healthy body fat percentage.

BMI can be measured both in emperical and metric units, i.e, in lb vs inches and kg vs cm respectively. This web app allows one to calculate in either unit depending on where you’re from, and even provides a chart of the different BMI ranges that correspond to different body fat levels.

Links

Application Panels

The web page contains two panels, the sidebar and the main panel.

The sidebar contains the options to pick which measurement you want, along with the entry fields for your height and weight.

The main panel has two tabs, the Results and the BMI chart. On pressing the calculate button in the sidebar, the results tab gets updated to display your BMI along with your classification according to the chart. The BMI chart displayed the range of values for each BMI classification.

BMI Calulator Code

observe({
    input$action_Calc ## checks if button has been pressed
    if(input$select_measure==1) ## metric measurement, i.e, kg vs cm
    {
      values$bmi = isolate({
        input$num_weight / ((input$num_height/100) *(input$num_height/100))
      })
    }
    else ## emperical measurement, i.e, lb vs inches
    {
      values$bmi = isolate({
        input$num_weight / (input$num_height *input$num_height)*703
      })
    }
  })

Example Screenshot