Gerard van Meurs
April 10, 2019
To test the BMI-app, please go to: https://gerardvanmeurs.shinyapps.io/BMI-Calculator.
With this Shiny-app you can calculate your Body Mass Index (BMI) based on:
The app:
Inside the server.R part:
bmi <- function(weight,height) {round(weight/((height/100)^2),1)}
bmiCat <- function(bmi){
ifelse(bmi < 18.5,"underweight",ifelse(bmi < 25,"normal weight",ifelse(bmi < 30,"overweight","obese")))
}
weight <- 75
height <- 175
(bmi_num <- bmi(weight, height)); bmiCat(bmi_num)
[1] 24.5
[1] "normal weight"