Create trailing_avg_group.r

Creates a trailing average/median across each group