| split | R Documentation |
Split a table into pieces by one or more grouping columns. When data
is not a data frame, dispatches to base::split() so the classic
split(vector, factor) idiom keeps working with basetable attached.
split(data, by, drop = FALSE, keep.by = TRUE)
data |
A data frame or data table, or an atomic vector. |
by |
For a data frame, a character vector of grouping columns. For an
atomic vector, a factor (or object coercible to one) the same length as
|
drop |
Whether to drop empty groups. |
keep.by |
Whether to keep grouping columns in each piece. Ignored
when |
A named list of basetables (data frame input) or a named list of vectors
(atomic vector input, matching base::split()).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.