0

I´m running a shiny app on an EDP server with the rocker/shiny:4.2.2 image. The shiny app uses several future.apply funcitionalities and shows progress by a progressr progress bar.

withProgressShiny( message = "Collecting results ", detail = "initialization", { p <- progressor(steps = 100) counter = 0 while(counter < 100){ counter=counter+1 p(message = "searching") } }) 

The progress bar is working really good with different future::plans (sequential, multisession, multicore) on my local machine but is not running on the server. The server just shows the "initialization" part of the progressr function during the whole while-loop but not the "searching" part.

Session info shows same versions of all used packages including R-version.

Seems to be a problem with the progressor() but not with the withProgressShiny() part.

Any suggestions how to solve the problem?

2 Answers 2

2

I found the solution to my problem in the fundamentals of progressr package:

R session on EDP Server was non-interactive so

interactive() FALSE 

The progressr package needs an interactive session by default. By actively setting

progressr.enable = TRUE 

in the R options for the image I overcome this problem and everything worked fine.

Sign up to request clarification or add additional context in comments.

Comments

0

I had the same problem except the server I am using is shinapps.io. I was able to modify Marcel's solution to fix the problem by simply placing

 options(progressr.enable = TRUE) 

by where I load the packages (notably, putting "progressr.enable = TRUE" in the same location as above or in the server() function did NOT resolve the problem). e.g.:

 library(shiny) library(progressr) handlers("progress") #add it here: options(progressr.enable = TRUE) ui <- fluidPage( ... ) server <- function( ... ) shinyApp(ui, server) 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.