Matt
June 6, 2017
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:
This app is a gas efficiency calculator based off of the mtcars dataset. Users have the following choices as inputs via sliders:
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).
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()
})
Click on the link below to go to the Shiny App!
Click on the link below to go to the Shiny source code!