progress icon indicating copy to clipboard operation
progress copied to clipboard

replicate function with a progressbar

Open DanChaltiel opened this issue 6 years ago • 0 comments

Hi there,

I often use base::replicate for simulations but not knowing when my replication will end was killing me.

Therefore, here is a simple rewriting of base::replicate that can use your progress bars.

For instance:

library(dplyr)
replicate_pb(50000, {rnorm(1)>1.65}) %>% {paste(mean(.), " - ", sd(.))}

This might need some rewriting to conform to your standards, naming, etc but I thought it could be interesting.

Kudos for this wonderful package! Dan

DanChaltiel avatar Dec 30 '19 19:12 DanChaltiel