Skip to contents

Takes in formula variables and average columns, as well as sort column argument. If sort_col is provided, an error is generated if it is not in formula_vars or average_cols. If sort_col is not provided, then warnings are generated that no average trend can be generated.

Usage

assert_group_sort_col(formula_vars, average_cols, sort_col)

Arguments

formula_vars

Variables included in the model formula, generated by all.vars(formula).

average_cols

Column name(s) of column(s) for use in grouping data for averaging, such as regions. If missing, uses global average of the data for infilling.

sort_col

Column name(s) to use to dplyr::arrange() the data prior to supplying type and calculating mean absolute scaled error on data involving time series. If NULL, not used. Defaults to "year".

Value

Column name for sorting averaged data to generate trend.