Created
December 4, 2012 18:45
-
-
Save jeffreyhorner/4207364 to your computer and use it in GitHub Desktop.
simpleTab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyServer(function(input, output) { | |
cat('shinyServer called\n',file=stderr()) | |
output$foo <- reactivePrint(function(){ | |
cat('output$foo called\n',file=stderr()) | |
input$n | |
}) | |
output$afunc <- reactivePrint(function() { | |
cat('output$summary called\n',file=stderr()) | |
Sys.sleep(4) | |
input$n | |
}) | |
output$bfunc <- reactivePrint(function() { | |
cat('output$table called\n',file=stderr()) | |
input$n | |
}) | |
output$plot <- reactivePlot(function(){ | |
cat('output$plot called\n',file=stderr()) | |
plot(rnorm(input$n)) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyUI(pageWithSidebar( | |
# Application title | |
headerPanel("Tabsets"), | |
sidebarPanel( | |
sliderInput("n", | |
"Number of observations:", | |
value = 500, | |
min = 1, | |
max = 1000) | |
), | |
mainPanel( | |
tabsetPanel( | |
tabPanel("A", verbatimTextOutput("afunc")), | |
tabPanel("B", verbatimTextOutput("bfunc")), | |
tabPanel("Plot",plotOutput('plot')) | |
) | |
) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment