Skip to contents

Produces averaged data frame that can then be passed for modelling.

Usage

get_average_df(df, cols, average_cols, weight_col = NULL)

Arguments

df

Data frame of model data.

cols

Name of numeric column(s) to take average of.

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.

weight_col

Column name of column of weights to be used in averaging, such as country population.

Value

Data frame of cols averaged across average_cols