BMI Calculator

Emma Sun
Oct 5th, 2016

Shiny APP

What is a shiny app?

  • You are going to interact with a shiny app.
  • Shiny is another product by RStudio and it is described by RStudio as “A web application framework for R”.

My shiny app: BMI Calculator

  • BMI Calculator helps you know your BMI and your health condition.
  • Simply input your weight in kgs and your height in centimeters, BMI Calculator will compute the BMI for you.
  • It will present you not only your BMI, but also your health condition.
  • A plot is added so you can see where you are at.

some code we use from server.R

  • This part of the code mainly shows you how we do the calculations and conditions.
library(shiny)
BMI<-function(weight,height) {weight/((height*0.01)^2)}
diagnostic_f<-function(weight,height){
  BMI_value<- weight/((height*0.01)^2)
  ifelse(BMI_value<18.5,"Underweight",
         ifelse(BMI_value<25,"Normal Weight",
                ifelse(BMI_value<30,"Overweight","Obesity")))
}

More info: