View source: R/standalone-struct-list.R
map_struct | R Documentation |
The map functions transform their input by applying a function to each element of a list or atomic vector and returning an object of the same length as the input.
map()
always returns a list. See the modify()
family for
versions that return an object of the same type as the input.
map_lgl()
, map_int()
, map_dbl()
and map_chr()
return an
atomic vector of the indicated type (or die trying). For these functions,
.f
must return a length-1 vector of the appropriate type.
map_vec()
simplifies to the common type of the output. It works with
most types of simple vectors like Date, POSIXct, factors, etc.
walk()
calls .f
for its side-effect and returns
the input .x
.
map_struct(.x, .f, ..., .progress = FALSE)
.x |
A list or atomic vector. |
.f |
A function, specified in one of the following ways:
|
... |
Additional arguments passed on to the mapped function. We now generally recommend against using # Instead of x |> map(f, 1, 2, collapse = ",") # do: x |> map(\(x) f(x, 1, 2, collapse = ",")) This makes it easier to understand which arguments belong to which function and will tend to yield better error messages. |
.progress |
Whether to show a progress bar. Use |
a 'struct_list'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.