Description Usage Arguments NOTE Examples
Filters list (at top-level only) by name or value.
1 | filter_list(list, name, value)
|
list |
a list |
name |
a name to search for within a list; can be anything that can appear as a name in a list |
value |
a value to search for within a list |
filter_list()
is useful for returning matches of a name or value.
Currently, it will only search the top-level in a list and matches must be
exact. Unlike purrr::pluck()
, filter_list()
will return all matches (not
just the first match).
1 2 3 4 5 6 | l <- list(this = 1, that = 2, that = 3, final = 2)
purrr::pluck(l, "that") # returns only first match
filter_list(l, "that") # returns all matches
filter_list(l, value = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.