Raphael Parrado
06/03/2019
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)
}
)
}
Thank you!!!
Shiny link: https://raphael393.shinyapps.io/TipCounter/
Githubcode: https://github.com/raphael393/Developing-Data-Products-Final-Project-