Skip to contents

Pulls out variables not being used for grouping that will be averaged, checks that they are numeric, and returns them.

Usage

get_formula_avg_cols(df, formula_vars, average_cols)

Arguments

df

Data frame of model data.

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.