I have a data frame with the following data
date type value
1/1/2016 a 1
1/1/2016 b 2
1/1/2016 a 1
1/1/2016 b 4
1/2/2016 a 1
1/2/2016 b 1
I'm trying to figure out how to create conditional aggregators after grouping by date, to perform an operation both across the entire day as well as for a particular type, with output as below
date sum_value avg_value a_sum a_max b_sum b_max
1/1/2016 8 2 2 1 6 4
1/2/2016 2 1 1 1 1 1