Created
December 31, 2013 01:44
-
-
Save markheckmann/8191104 to your computer and use it in GitHub Desktop.
shiny progress bar
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) | |
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) | |
}) | |
}) | |
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) | |
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