R/flat-map2.R
, R/flat-pmap.R
flat-map2-df.Rd
These functions are variants of flat_map_dfr()
and flat_map_dfc()
that
iterate over multiple arguments simultaneously.
flat_map2_dfr(.x, .y, .f, ..., .ptype = NULL, .names_to = NULL, .name_repair = c("unique", "universal", "check_unique")) flat_map2_dfc(.x, .y, .f, ..., .ptype = NULL, .size = NULL, .name_repair = c("unique", "universal", "check_unique", "minimal")) flat_pmap_dfr(.l, .f, ..., .ptype = NULL, .names_to = NULL, .name_repair = c("unique", "universal", "check_unique")) flat_pmap_dfc(.l, .f, ..., .ptype = NULL, .size = NULL, .name_repair = c("unique", "universal", "check_unique", "minimal"))
.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 |
.names_to | Optionally, the name of a column where the names
of |
.name_repair | One of With |
.size | If, Alternatively, specify the desired number of rows, and any inputs of length 1 will be recycled appropriately. |
.l | A list of vectors, such as a data frame. The length of |
#> x y #> 1 1 4 #> 2 2 5 #> 3 3 6