Skip to content

Instantly share code, notes, and snippets.

@zero323
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save zero323/7ddd71fd40b0067b56e9 to your computer and use it in GitHub Desktop.

Select an option

Save zero323/7ddd71fd40b0067b56e9 to your computer and use it in GitHub Desktop.
library(shiny)
predict <- function(foo_or_bar) { ifelse(foo_or_bar, 'Foo', 'Bar') }
runApp(shinyApp(
ui = shinyUI(fluidPage(
fluidRow(
column(12, checkboxInput('foo_or_bar', 'Foo or bar?'), textOutput('text'))
)
)),
server = shinyServer(function(input, output) {
output$text <- renderText({ predict(input$foo_or_bar) })
})
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment