Skip to contents

Apply a function to each element of a list or vector with automatic checkpointing and recovery. If interrupted, simply run the same code again to resume from where it left off.

Usage

s_map(.x, .f, ..., .id = NULL, .session_id = NULL)

s_map_chr(.x, .f, ..., .id = NULL, .session_id = NULL)

s_map_dbl(.x, .f, ..., .id = NULL, .session_id = NULL)

s_map_int(.x, .f, ..., .id = NULL, .session_id = NULL)

s_map_lgl(.x, .f, ..., .id = NULL, .session_id = NULL)

s_map_dfr(.x, .f, ..., .id = NULL, .session_id = NULL)

s_map_dfc(.x, .f, ..., .id = NULL, .session_id = NULL)

Arguments

.x

A list or atomic vector to map over.

.f

A function, formula, or vector.

...

Additional arguments passed to .f.

.id

Either a string or NULL (used for dfr/dfc variants).

.session_id

Character. Optional session ID for this operation. If NULL (default), a session ID is automatically generated from the input data, enabling seamless recovery without user intervention.

Value

A list, same as purrr::map.

A character vector.

A double vector.

An integer vector.

A logical vector.

A data frame (row bind).

A data frame (column bind).

Examples

# Basic usage - identical to purrr::map
result <- s_map(1:10, ~ .x^2)
#> [10%] Processing items 1-10 of 10
#> Completed 10 items