Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replicate function with a progressbar #99

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DanChaltiel
Copy link

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

A simple rewriting of `base::replicate` that can use progress bars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant