dt_op: Run an operation on a data.table

Description Usage Arguments Value See Also Examples

View source: R/dtplyr.R

Description

Expose data.table's square-bracket-based functionality as a method. This makes it more natural to use with the pipe operator.

Usage

1

Arguments

df

An R object that can be coerced to a data.table

...

Additional arguments for [.data.table

Value

data.table

See Also

data.table

Examples

1
2
3
df <- data.frame(a = c(1, 1, 2, 2, 3, 3), b = 1:6)
dt_op(df, a > 1, sum(b), keyby = a)
df %>% dt_op(a > 1, sum(b), keyby = a)

mcskinner/dtplyr documentation built on Nov. 4, 2019, 6:23 p.m.