in_case_list | R Documentation |
These functions are equivalent to in_case()
, switch_case()
,
grep_case()
, fn_case()
, and fn_switch_case()
but return
lists.
in_case_list(..., preserve = FALSE, default = NA)
switch_case_list(x, ..., preserve = FALSE, default = NA)
grep_case_list(x, ..., preserve = FALSE, default = NA)
fn_case_list(x, fn, ..., preserve = FALSE, default = NA)
fn_switch_case_list(x, fn, ..., preserve = FALSE, default = NA)
... |
<
|
preserve |
If |
default |
If |
x |
A vector |
fn |
A function to apply to the left-hand side of each formula in Either a quoted or unquoted function name, an anonymous The function should take two inputs, the first being |
This can be useful when returning a non-atomic value and/or when you want to create a list column inside a tibble.
A list of length 1 or n, matching the length of the logical input vector.
in_case()
, switch_case()
, grep_case()
, fn_case()
, and
fn_case_fct()
on which these functions are based.
1:3 %>%
in_case_list(
. < 2 ~ mtcars,
default = letters
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.