dtplyr (version 1.0.1)

group_modify.dtplyr_step: Modify a lazy_dt in place

Description

group_modify() applies .f to each group, returning a modified lazy_dt(). This function is a little less flexible than the data.frame method due to the constraints of the code generation that dtplyr uses.

Usage

# S3 method for dtplyr_step
group_modify(.tbl, .f, ..., keep = FALSE)

Arguments

.tbl
.f

The name of a two argument function. The first argument is passed .SD,the data.table representing the current group; the second argument is passed .BY, a list giving the current values of the grouping variables. The function should return a list or data.table.

...

Additional arguments passed to .f

keep

Not supported for lazy_dt.

Examples

Run this code
# NOT RUN {
library(dplyr)

mtcars %>%
  lazy_dt() %>%
  group_by(cyl) %>%
  group_modify(head, n = 2L)
# }

Run the code above in your browser using DataLab