key-by-scoped {keyholder}R Documentation

Key by selection of variables

Description

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.

Usage

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)

Arguments

.tbl

Reference data frame .

.funs

Parameter for scoped functions.

...

Parameter for scoped functions.

.add

Whether to add keys to (possibly) existing ones. If FALSE keys will be overridden.

.exclude

Whether to exclude key variables from .tbl.

.predicate

Parameter for scoped functions.

.vars

Parameter for scoped functions.

See Also

Not scoped key_by()

Examples

mtcars %>% key_by_all(.funs = toupper)

mtcars %>% key_by_if(rlang::is_integerish, toupper)

mtcars %>% key_by_at(c("vs", "am"), toupper)


[Package keyholder version 0.1.7 Index]