key-by-scoped | R Documentation |
These functions perform keying by selection of variables using corresponding scoped variant of select. Appropriate data frame is selected with scoped function first, and then it is assigned as keys.
key_by_all(.tbl, .funs = list(), ..., .add = FALSE, .exclude = FALSE)
key_by_if(.tbl, .predicate, .funs = list(), ..., .add = FALSE,
.exclude = FALSE)
key_by_at(.tbl, .vars, .funs = list(), ..., .add = FALSE,
.exclude = FALSE)
.tbl |
Reference data frame . |
.funs |
Parameter for scoped functions. |
... |
Parameter for scoped functions. |
.add |
Whether to add keys to (possibly) existing ones. If |
.exclude |
Whether to exclude key variables from |
.predicate |
Parameter for scoped functions. |
.vars |
Parameter for scoped functions. |
Not scoped key_by()
mtcars %>% key_by_all(.funs = toupper)
mtcars %>% key_by_if(rlang::is_integerish, toupper)
mtcars %>% key_by_at(c("vs", "am"), toupper)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.