Extended aggregation.R example with higher level aggregation
added TODO