aggregate_by_pkg function

Aggregate by base R or data.table