These functions are variants of flat_map_vec()
that iterate over multiple
arguments simultaneously.
flat_map2_vec(.x, .y, .f, ..., .ptype = NULL, .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal")) flat_map2_lst(.x, .y, .f, ..., .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal")) flat_map2_dbl(.x, .y, .f, ..., .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal")) flat_map2_int(.x, .y, .f, ..., .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal")) flat_map2_chr(.x, .y, .f, ..., .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal")) flat_map2_lgl(.x, .y, .f, ..., .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal")) flat_pmap_vec(.l, .f, ..., .ptype = NULL, .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal")) flat_pmap_lst(.l, .f, ..., .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal")) flat_pmap_dbl(.l, .f, ..., .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal")) flat_pmap_int(.l, .f, ..., .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal")) flat_pmap_chr(.l, .f, ..., .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal")) flat_pmap_lgl(.l, .f, ..., .name_spec = NULL, .name_repair = c("minimal", "unique", "check_unique", "universal"))
.x, .y | Vectors of the same length. A vector of length 1 will be recycled. |
---|---|
.f | A function, formula, or vector (not necessarily atomic). If a function, it is used as is. If a formula, e.g.
This syntax allows you to create very compact anonymous functions. If character vector, numeric vector, or list, it is
converted to an extractor function. Character vectors index by
name and numeric vectors index by position; use a list to index
by position and name at different levels. If a component is not
present, the value of |
... | Additional arguments passed on to the mapped function. |
.ptype | If Alternatively, you can supply |
.name_spec | A name specification for combining
inner and outer names. This is relevant for inputs passed with a
name, when these inputs are themselves named, like
See the name specification topic. |
.name_repair | How to repair names, see |
.l | A list of vectors, such as a data frame. The length of |
#> [1] 1 6 2 7 3 8 4 9 5 10