Developing Data Products Course Project

Matt
June 6, 2017

About This Project

This is the final project for the Developing Data Products course for the Johns Hopkins' Data Science Certification.

The goals of this project were to:

  1. Build an interactive app in Shiny
  2. Write this presentation in RStudio Slidify

What Does This App Do?

This app is a gas efficiency calculator based off of the mtcars dataset. Users have the following choices as inputs via sliders:

  • Number of engine cylinders
  • Horsepower
  • Vehicle weight (1,000 lb increments)

Based upon the user's choice on each input, the app will calculate the estimated gas efficiency and return that value in miles per gallon (mpg).

Server Calculation

The server calculates the gas efficiency with a simple multivariate linear model.

m <- lm(mpg ~ cyl + hp + wt, data = mtcars)
        mPred <- reactive({
                cyl_slide <- input$cylInput
                hp_slide <- input$hpInput
                weight_slide <- input$weightInput
                input_df <- data.frame(cyl = cyl_slide, hp = hp_slide,
                                       wt = weight_slide)
                predict(m, newdata = input_df)
                }) 
        output$mPred_ui <- renderPrint({
                mPred()
                })

Ready to Give It a Whirl?

Click on the link below to go to the Shiny App!

Click on the link below to go to the Shiny source code!