The progressify package allows you to easily add progress
reporting to sequential and parallel map-reduce code by piping to the
progressify() function. Easy!
library(progressify)
handlers(global = TRUE)
library(car)
fit <- lm(mpg ~ wt + hp, data = mtcars)
res <- Boot(fit, R = 999) |> progressify()
This vignette demonstrates how to use this approach to add progress
reporting to car functions such as Boot().
The car Boot() function bootstraps regression models, such as
lm(), glm(), and nls() fits. It refits the model R times on
resampled data, and collects the statistics of interest from each
refit. For example,
library(car)
fit <- lm(mpg ~ wt + hp, data = mtcars)
res <- Boot(fit, R = 999)
Here Boot() provides no feedback on how far it has progressed, but
we can easily add progress reporting by using:
library(car)
library(progressify)
handlers(global = TRUE)
fit <- lm(mpg ~ wt + hp, data = mtcars)
res <- Boot(fit, R = 999) |> progressify()
Using the default progress handler, the progress reporting will appear as:
|===== | 20%
The progressify() function supports the following car
functions:
Boot()There are no progress updates when Boot() processes the bootstrap
replicates in parallel via its ncores argument. A bootstrap replicate
for which the refitted model is rank deficient does not report on
progress, so the progress might not reach 100% until Boot() is done.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.