Last chance! 50% off unlimited learning
Sale ends in
Implementation of a simple formula interface for the split
function.
# S3 method for formula
split (x, f, drop = FALSE, data = NULL, ...)
a formula of the form y ~ x
.
a 'factor' in the sense that as.factor(f)
defines the grouping, or a list of such factors in which case their interaction is used for the grouping.
logical indicating if levels that do not occur should be dropped (if f
is a factor
or a list).
Defaults to FALSE.
the data frame from which the formula should be evaluated.
other arguments to be passed to
split
.
# NOT RUN {
split(extra ~ group, data = sleep)
# }
Run the code above in your browser using DataLab