Learn R Programming

doBy (version 0.4)

splitBy: Split a data frame

Description

This is essentially a wrapper for the 'split' function, - the important difference being that variables to order by can be given by a model formula.

Usage

splitBy(formula, data = parent.frame(), drop=FALSE)

Arguments

formula
The right hand side of a formula
data
A data frame
drop
Logical indicating if levels that do not occur should be dropped

Value

  • A list of data frames

See Also

~~objects to See Also as help, ~~~

Examples

Run this code
data(dietox)
splitBy(formula = ~Evit+Cu, data = dietox)

Run the code above in your browser using DataLab