Last week I searched for a replacement for group_by + do
, and this ended with split + map_dfr
being my favourite alternative. Conceptually it was the most compact representation of the idea (just 2 commands) and avoided a the extra work that seemed necessary to nest a data.frame and operate on the nested data.
Tidyverse
My prior post on tidyverse split-apply-combined ended with me favouring split + map_dfr
as a replacement for group_by + do
.
In subsequent posts I looked at the runtime of the split function and the idioscrasies of the split function and saw the following for the Base R split()
function: