BMI Calculator Using Shiny App

Trupti Palande
23 May 2015

Course Project
Developing Data Products Course
Data Science Specialization
Coursera and John Hopkins University

Objective

Build an application to demonstrate following skill :

• use of various widgets of 'shiny' tool
• understanding of the process of publishing application in shiny
• interface with R using embeded R code

Project Detail

The application developed is a BMI calculator. This application takes height in CM and weight in KG of person as input and displays the BMI of the user. Following code demostrates the calculation part.

height<- 150
weight <- 56

bmi<- weight/(height*0.01 * height * 0.01)  

bmi
[1] 24.88889

User Interface : Application - Widgets

It includes 4 widgets:

  • numericInput - A field to enter numbers, in this case - the height (in CM) and weight(KG)
  • actionButton - An Action Button, in this case to provide non-reactive reactivity to refresh and calculate value of BMI.
  • Textfield - to display entered value by user.
  • TabPanel - to show result and documentation on separate TAB

Application - Link and Code