Learn R Programming

table.express (version 0.1.1)

key_by: Set key of the result

Description

Group by and set key of the result.

Usage

key_by(.data, ...)

# S3 method for ExprBuilder key_by(.data, ..., .parse = getOption("table.express.parse", FALSE))

Arguments

.data

Object to be grouped and subsequently keyed.

...

Arguments for the specific methods.

.parse

Logical. Whether to apply rlang::parse_expr() to obtain the expressions.

Details

Everything in ... will be wrapped in a call to list. Its contents work like Clauses for grouping on columns. The keyby inside the data.table::data.table frame.

To see more examples, check the vignette, or the table.express-package entry.

Examples

Run this code
# NOT RUN {
data("mtcars")

data.table::as.data.table(mtcars) %>%
    start_expr %>%
    key_by(cyl, gear)

# }

Run the code above in your browser using DataLab