Re: [R] Creating dataframe with subtotals by all fields and totals of subtotals

2016-09-14 Thread David Winsemius
> On Sep 14, 2016, at 12:33 PM, Peter Lomas wrote: > > Hello R-Helpers, > > I'm trying to to create a subtotal category for each column in a > dataset, and totals of subtotals, resulting in one data frame. I > figure I could do this by a whack of aggregate() and rbind(), but I'm > hoping there

[R] Creating dataframe with subtotals by all fields and totals of subtotals

2016-09-14 Thread Peter Lomas
Hello R-Helpers, I'm trying to to create a subtotal category for each column in a dataset, and totals of subtotals, resulting in one data frame. I figure I could do this by a whack of aggregate() and rbind(), but I'm hoping there is a simpler way. Below is a sample dataset. Underneath I create a