slow_fn <- function(x) { Sys.sleep(0.01); x^2 }
x <- 1:100
# Basic usage
fmap(x, slow_fn)
# With progress bar
fmap(x, slow_fn, pb = TRUE)
# With parallel execution (non-Windows)
# \donttest{
if (.Platform$OS.type != "windows") {
fmap(x, slow_fn, ncores = 2, pb = TRUE)
}
# }
Run the code above in your browser using DataLab