Skip to content

Instantly share code, notes, and snippets.

@jcheng5
Forked from jeffreyhorner/server.R
Created December 14, 2012 21:50
Show Gist options
  • Save jcheng5/4288960 to your computer and use it in GitHub Desktop.
Save jcheng5/4288960 to your computer and use it in GitHub Desktop.
library(shiny)
shinyServer(function(input, output) {
re <- reactive(function(){
cat("re called\n",file=stderr())
input$n
})
output$ntext <- reactiveText(function() {
cat("output$ntext called\n",file=stderr())
paste(input$n," * 2 =",input$n + re())
})
})
shinyUI(bootstrapPage(
sliderInput('n', 'N', 1, 10, 1)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment