Description Usage Arguments Value
map_dict
calls a function on each (key, value) pair and builds a dictionary from the transformed input
(see map in package purrr
).
keep_dict
and discard_dict
keep and discard elements based on the return value of the
predicate function (see keep and discard in package purrr
).
compact_dict
returns a dictionary with all the NULL
values removed.
1 2 3 4 5 6 7 |
dict |
A dictionary |
.f |
A function, formula or character vector. |
.p |
A predicate function returning a logical value. If a function, it is called with two arguments, the key and the value. If a formula, .x corresponds to the key and .y to the value. If a character vector, it will return the values corresponding to the keys in the vector. |
For map_dict
, a dictionary with the same keys as dict
, and values
given by the return value of .f
. For keep_dict
, discard_dict
, and
compact_dict
, a dictionary containing the entries that passed the filter.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.