Developing data products

Course project

Cynthia Li
Data scientist

Handy BMI application for pregnancy weight gain

  • Why is it needed?
  1. A woman's weight and height will exert an influence on how much she would gain weight during pregnancy
  2. We use "body mass index," or BMI as measurement metrics

How does the calculation work?

  • The calculator takes 2 inputs:
  1. Pre-pregnancy height (in cm)
  2. Pre-pregnancy weight (in kg)
pBMI<-function(Weight,Height) {
        if (Weight==0 | Height==0) return(NA)
        else  return(round(Weight/(Height/100)^2,1))
}

How to use the calculation application?

  • The user selects the relevant values using a sidebar panel.

  • BMI is calculated in the main panel using the formula in previous slide(embedded R code)

  • The user's recommended pregnancy weight gain will be printed.

Resources