1

I have noticed some strange behavior when using Windows progress bars in RStudio vs. Base R. Specifically, RStudio creates a progress bar in its own window (standalone in the taskbar), while Base R creates a progress bar in an "R window" (grouped together with R in the taskbar). See screenshot below for example.

For my purposes, this becomes an issue when using Shiny applications because my progress bars do not pop up in front of the browser when using Base R (the user needs to click over to the R window in order to see them - see screenshot), while they do pop up as desired when running the exact same code in RStudio.

Is there a way to change the behavior of progress bars in Base R to match the desired behavior in RStudio? I have tried looking through options() but couldn't find anything about progress bars.

Progress Bars

Here's a toy example using Shiny if you want to try it out:

# Simple progress bar app
require(shiny)
runApp(list(
  ui = bootstrapPage(
    actionButton("goButton", "Go!")
  ),
  server = function(input, output) {
    observe({
      if(input$goButton > 0) {
        pb = winProgressBar("test progress bar", "Some information in %",0, 100, 0)
        u = c(0, sort(runif(20, 0, 100)), 100)
        for(i in u) {
          Sys.sleep(0.1)
          info <- sprintf("%d%% done", round(i))
          setWinProgressBar(pb, i, "test progress bar", info)
        }
        Sys.sleep(2)
        close(pb)
      }
    })
  }
))
Nick
  • 1,018
  • 7
  • 13
  • Note: This issue also happens with the file.choose() window. – Nick Apr 07 '14 at 20:00
  • Why do you want to show a progress bar on the server side? I think what you should do is to show the progress on the client side. See [here](http://stackoverflow.com/questions/18237987/show-that-shiny-is-busy-or-loading-when-changing-tab-panels) for an example. – Randy Lai Apr 07 '14 at 20:22
  • A radical solution would be to uninstall R and re-install it in MDI (multiple device interface) mode. However, then not only progress bars but also graphics devices and help pages (if you chose text mode in installation) will be opened in separate windows. I don't know a way to do this for the progress bar only. – Stephan Kolassa Apr 07 '14 at 20:30

1 Answers1

0

Another roundabout solution if you are using Windows and have PowerToys installed would be to use the Always On Top utility; click on your test progress bar window and use the shortcut Windows key+Ctrl+T.

For me, the progress window was popping up on top for the base R version of the example after running this.

Roman
  • 18
  • 4