I am using replicate
to run my own analyse
function multiple times (analyse
returns a list):
results <- replicate(reps, analyse())
Is there a way to add progress bar, showing the percentage of replications finished at the moment? I have tried with txtProgressBar
, but don't know how to make it work without a for-loop.
EDIT: reproducible example of replicate:
analyse <- function() {
out <- list('a' = vector('list', 5), 'b' = vector('list', 5))
}
results <- replicate(3, analyse())
In my case, output of analyse
is a deep list of lists with results. I would like the progress bar to update every time a new column of results
is filled in, so after each replication.
analyse
function along withSys.sleep(1)
to explicitly print progress – Dyarchyindicator
i mentioned as global variable and access it usingtxtProgressBar
or other progress indicator at some time intervals – Dyarchy