Recursivly split a data.frame
When there are multiple factors to split by, Base R split returns a flattened structure by splitting on the interaction of all factors. rsplit instead returns a nested list-of-lists.
rsplit(x, by, drop = FALSE)
x |
a data.frame or vector |
by |
a data.frame of factors |
drop |
drop unused factor levels |
a nested list of dataframes, split by each element of by
Inspired by, but different from the below
Neal Fultz
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.