Learn R Programming

abjutils (version 0.2.3)

pvec: Verbose, parallel, and safe map-like

Description

Using the same argument notation as purrr::map(), this function iterates over a list of inputs .x, applying .f to each element. It returns a tibble with the id, whether the function returned an error and the output.

Usage

pvec(.x, .f, ..., .cores = get_cores(), .progress = TRUE,
  .flatten = FALSE, .options = future_options())

Arguments

.x

A list or atomic vector

.f

A function, formula, or atomic vector (see purrr::map())

...

Other parameters passed on to .f

.cores

Number of cores to use when multiprocessing

.progress

Whether or not to display progress

.flatten

If TRUE, the errors are filtered from the output, and the returned object is flattened (a vector, a list, or a tibble)

.options

Options passed on to furrr::future_map() (furrr::future_options() by default)

Value

A tibble with 3 columns: input, return, and output

See Also

purrr::map(), furrr::future_map(), furrr::future_options()