Skip to content

Instantly share code, notes, and snippets.

@markheckmann
Created December 31, 2013 01:44
Show Gist options
  • Save markheckmann/8191104 to your computer and use it in GitHub Desktop.
Save markheckmann/8191104 to your computer and use it in GitHub Desktop.
shiny progress bar
library(shiny)
library(shinyIncubator)
shinyServer(function(input, output, session) {
output$out2 <- renderPrint({
"output 2"
})
output$plot <- renderPlot({
withProgress(session, min=1, max=15, {
setProgress(message = 'Calculation in progress',
detail = 'Go and get a coffee :D')
for (i in 1:15) {
setProgress(value = i)
Sys.sleep(0.5)
}
})
plot(cars)
})
})
library(shiny)
library(shinyIncubator)
shinyUI(bootstrapPage(
progressInit(),
plotOutput("plot"),
verbatimTextOutput("out2")
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment