Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. library(shiny)
  2.  
  3. predict <- function(foo_or_bar) { ifelse(foo_or_bar, 'Foo', 'Bar') }
  4.  
  5. runApp(shinyApp(
  6.  
  7. ui = shinyUI(fluidPage(
  8. fluidRow(
  9. column(12, checkboxInput('foo_or_bar', 'Foo or bar?'), textOutput('text'))
  10. )
  11. )),
  12.  
  13. server = shinyServer(function(input, output) {
  14.  
  15. output$text <- renderText({ predict(input$foo_or_bar) })
  16.  
  17. })
  18. ))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement