Developing Data Products Final Project - The Interactive Tip Counter

Raphael Parrado
06/03/2019

Objective

  • Create a Shiny application and deploy it on Rstudio's servers.
  • Use Slidify or Rstudio Presenter to prepare a reproducible pitch presentation about your application.

The Application

  • After a great meal, tiping can always be confusing. How did it feel? Would it be 10%? 15%? 20%?.
  • Even after you decide comes the hard part, DOING THE MATH!!
  • The purpose of our app is to simplify your life.
  • Just input your bill, how you felt and voila!

alt text

The Application

shinyUI(fluidPage(
  titlePanel("How much should I tip?"),
    sidebarLayout(
    sidebarPanel(
      h3 ("Total bill in USD"),
      h5 ("Slide me! and then Select how good was the Service"),
      sliderInput("slider1","USD",min = 1, max = 250,value = 1, step=0.1), 
      selectInput("select","How was the service?", 
                   choices = list("Okay"=1,"Good"=2, "Excelent"=3),
                   selected = 1),
     actionButton("button","How Much?")
        ),
    mainPanel(
       h3 ("So the total amount going on my tip is!"),
       h4 (textOutput("text1"),style = "color:green"),
       h4 ("Dollars",style="color:green"),
    )
  )
))

Help text omited to appreciate the code (links at the end)

shinyServer<- function(input, output,session) {
   observeEvent (input$button, {
    if(input$select=="1"){
    value <- 0.15    
  } else {
    if(input$select=="2"){
      value <- 0.18   
    } else {
      value <- 0.2
    }
  }
  n <- input$slider1 * value 
  output$text1 <- renderText(n)
}
)
}

Interactive Tip Counter

alt text

  1. Select with the scroller how much was the bill
  2. How did you feel?
  3. How much?
  4. Time to pay!