Apply a function to each element of a vector or list
The map functions transform their input by applying a function to each element and returning a list/vector/data.table.
map.()
returns a list
_lgl.()
, _int.()
, _dbl.()
,_chr.()
, _df.()
variants return their specified type
_dfr.()
& _dfc.()
Return all data frame results combined utilizing row or column binding
map.(.x, .f, ...) map_lgl.(.x, .f, ...) map_int.(.x, .f, ...) map_dbl.(.x, .f, ...) map_chr.(.x, .f, ...) map_dfc.(.x, .f, ...) map_dfr.(.x, .f, ..., .id = NULL) map_df.(.x, .f, ..., .id = NULL) walk.(.x, .f, ...) map2.(.x, .y, .f, ...) map2_lgl.(.x, .y, .f, ...) map2_int.(.x, .y, .f, ...) map2_dbl.(.x, .y, .f, ...) map2_chr.(.x, .y, .f, ...) map2_dfc.(.x, .y, .f, ...) map2_dfr.(.x, .y, .f, ..., .id = NULL) map2_df.(.x, .y, .f, ..., .id = NULL)
.x |
A list or vector |
.f |
A function |
... |
Other arguments to pass to a function |
.id |
Whether |
.y |
A list or vector |
map.(c(1,2,3), ~ .x + 1) map_dbl.(c(1,2,3), ~ .x + 1) map_chr.(c(1,2,3), as.character)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.