Calculate Your BMI

A pitch for my Shiny app

by Lisa, Data Rockstar

The Problem

According to the CDC, more than one-third of U.S. adults are obese. Obesity costs the U.S. $147 billion per year.

Body mass index or BMI is a way of calculating whether a person is underweight, normal, overweight, or obese, using just the person's height and weight.

The App

With the Calculate Your BMI app, it's easy to find out if you're at a healthy weight. Simply enter your height and weight in the user-friendly, responsive interface using any web browser. Your BMI is calculated and the results returned to you instantly, along with the category that the BMI puts you in.
screenshot of app with results

How it Works

The app was built using R and Shiny and deployed using Rstudio's Shiny servers. Once users enter their height and weight, the app uses the CDC's formula for calculating BMI:

\[ \frac{weight}{height^2}*703\]

In R, it looks a little like this:

weight <- 105
height <- 62
BMI <- (weight/(height^2))*703
BMI
## [1] 19.2

How it Works

The app then uses conditional logic to determine what category the BMI puts the user in.

category <- ifelse(BMI >= 30, "obese", 
               ifelse(BMI >=25, "overweight", 
                  ifelse(BMI >=18.5, "normal", "underweight")))
category
## [1] "normal"

That's it! Take your health into your hands today by calculating your BMI with the Calculate Your BMI app.