aggregateTS function

Aggregate a time series