Furrr
The combination of map and future (parallel processing)
future::plan()¶
specifies how future():s are resolved, e.g. sequentially or in parallel.
- sequential: Resolves futures sequentially in the current R process
- multisession: Resolves futures asynchronously (in parallel) in separate R sessions running in the background on the same machine
implementation examples¶
df <- data.frame(
x = c("apple", "banana", "cherry"),
pattern = c("p", "n", "h"),
replacement = c("x", "f", "q"),
stringsAsFactors = FALSE
)
future_pmap(df, gsub)
future_pmap_chr(df, gsub)