Examples for 'shiny::withProgress'


Reporting progress (functional API)

Aliases: withProgress setProgress incProgress

Keywords:

### ** Examples

## Only run examples in interactive R sessions
if (interactive()) {
options(device.ask.default = FALSE)

ui <- fluidPage(
  plotOutput("plot")
)

server <- function(input, output) {
  output$plot <- renderPlot({
    withProgress(message = 'Calculation in progress',
                 detail = 'This may take a while...', value = 0, {
      for (i in 1:15) {
        incProgress(1/15)
        Sys.sleep(0.25)
      }
    })
    plot(cars)
  })
}

shinyApp(ui, server)
}
Error in loadNamespace(name): there is no package called 'webshot'

[Package shiny version 1.5.0 Index]