1

I have a R script called parallel_progress_reprex.R that executes code in parallel and tracks the progress using progressr:

library(progressr) ## use progressr for procession updates
library(doFuture)  ## attaches also foreach and future
registerDoFuture() ## tell foreach to use futures
plan(multisession) ## parallelize over a local PSOCK cluster

xs <- 1:8

with_progress({
  p <- progressor(along = xs) 
  y <- foreach(x = xs) %dopar% {
    p()                       
    Sys.sleep(1)
    sqrt(x)
  }
})

When execuded in the interactive mode or with source("parallel_progress_reprex.R") this displays a progress bar which tracks my progress. However, when I use the `rstudioapi::jobRunScript`` command the progress bar is not displayed anymore.

rstudioapi::jobRunScript("parallel_progress_reprex.R")

How can the progress bar be forced to show up using rstudioapi::jobRunScript?

Doctor G
  • 163
  • 9
  • Cross-posted here: https://github.com/HenrikBengtsson/progressr/discussions/141. Thanks for waiting a while before cross-posting! – scottkosty Aug 16 '22 at 12:10
  • @scottkosty What do you mean by 'a while'? I thought 1 month of waiting is enough. Other forums close the questions after 21 days anyways so I thought it is appropriate to repost elsewhere. – Doctor G Aug 22 '22 at 07:12
  • I agree that 1 month is more than long enough. I don't know what others prefer. I would think a few days or a week is sufficient. But just to reemphasize: next time you cross-post, please post links to the other forums. I'm sorry you haven't received an answer on either forum. I do not know the answer to your question. – scottkosty Aug 22 '22 at 15:23

0 Answers0