View source: R/main_dt_ddply.R
dt_ddply | R Documentation |
data.table
, apply function, and return results in a data.table
.For each subset of a data.table
, apply function then combine results into a data.table
.
dt_ddply(
.data,
.variables,
.f = NULL,
...,
.progress = "none",
.drop = TRUE,
.parallel = FALSE
)
dt_ldply(
.data,
.f = NULL,
...,
.progress = "none",
.parallel = FALSE,
.id = NA
)
dt_dlply(
.data,
.variables,
.f = NULL,
...,
.progress = "none",
.drop = TRUE,
.parallel = FALSE
)
.data |
data frame to be processed |
.variables |
variables to split data frame by, as |
.f |
A function, specified in one of the following ways:
|
... |
other arguments passed on to |
.progress |
name of the progress bar to use, see
|
.drop |
should combinations of variables that do not appear in the input data be preserved (FALSE) or dropped (TRUE, default) |
.parallel |
if |
dt <- data.table(x = 1:10, y = 1:5)
dt_dlply(dt, .(y), ~.[which.max(x)])
dt_ddply(dt, .(y), ~ top_n(., 1, x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.