I have a large data frame that consists of data that looks something like this:
date w x y z region
1 2012 01 21 43 12 3 NO
This is a perfect situation for the plyr
package:
require(plyr)
ddply(my_df, .(date), my_function, extra_arg_1, extra_arg_2)
where my_function
is the function you want to perform on the split data frames, and extra_arg
s are any extra arguments that need to go to that function.
ddply
(d
ata frame -> d
ata frame) is the form you want if you want your results in a data frame; dlply
returns a list.