Create generalized_aggregator.r

A generalized function to aggregate data in the columns of a matrix