Change aggregation history in col names to stepwise columns
agg_names_to_cols.Rd
By default, aggregation history (function and level) is tracked in the column names for memory purposes and to keep units clear. But it's usually more useful to be able to access that information, so this parses the names of the aggregated columns into columns for the aggregation function at each aggregation level.
Arguments
- aggdf
aggregated dataframe or tibble
- aggsequence
a list of the names of the aggregation. works best if the list passed to the calling function is named, and those names are passed in here.Typically it will be the second value in each theme aggregation step (the to-theme), or the name of the spatial polygons. But extracting those when unnamed isn't well tested.
- funsequence
a list of functions (as characters or lists of names and arguments) to apply to do the aggregation at each step defined in
aggsequence
. Can be multiple funs per aggregation step.- aggCols
the name(s) of the original columns that were aggregated.