Hi,
I wish to create a function replacing basic purr::map with progress line (similar to the one in furrr for paralllel).
I found an example on the web, but it does not print the progress line and I can't figure out why:
s=letters
names(s)=LETTERS
map_df_progress <- function(.x, .f, ..., .id = NULL) {
.f <- purrr::as_mapper(.f, ...)
pb <- progress::progress_bar$new(total = length(.x), force = TRUE)
f <- function(...) {
pb$tick()
.f(...)
}
purrr::map_df(.x, f, ..., .id = .id)
}
map_df_progress(s, ~ str_c(., "asxde"))