Skip to contents

Safe Map2 - Drop-in Replacement for purrr::map2 with Auto-Recovery

Usage

s_map2(.x, .y, .f, ..., .id = NULL, .session_id = NULL)

s_map2_chr(.x, .y, .f, ..., .id = NULL, .session_id = NULL)

s_map2_dbl(.x, .y, .f, ..., .id = NULL, .session_id = NULL)

s_map2_int(.x, .y, .f, ..., .id = NULL, .session_id = NULL)

s_map2_lgl(.x, .y, .f, ..., .id = NULL, .session_id = NULL)

s_map2_dfr(.x, .y, .f, ..., .id = NULL, .session_id = NULL)

s_map2_dfc(.x, .y, .f, ..., .id = NULL, .session_id = NULL)

Arguments

.x, .y

Vectors of the same length.

.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.

Value

A list.

Examples

s_map2(1:5, 6:10, `+`)
#> [20%] Processing items 1-5 of 5
#> Completed 5 items
#> [[1]]
#> [1] 7
#> 
#> [[2]]
#> [1] 9
#> 
#> [[3]]
#> [1] 11
#> 
#> [[4]]
#> [1] 13
#> 
#> [[5]]
#> [1] 15
#>