expand_df_filter: Filter 'expand_df'

View source: R/expand_df.R

expand_df_filterR Documentation

Filter expand_df

Description

Used within expand_df() to filter out the data based on the arguments keep_no_obs and keep_before_obs.

Usage

expand_df_filter(
  df,
  response,
  keep_no_obs,
  keep_before_obs,
  sort_col,
  sort_descending,
  group_col
)

Arguments

df

Data frame.

response

Column name of response variables whose missing values will be infilled and projected, defaults to "value".

keep_no_obs

Logical value indicating whether or not to keep rows in the expanded data frame when there is no data. Defaults to TRUE. This is done based on the group_col, if provided.

keep_before_obs

Logical value indicating when data is available, whether or not to keep rows in the expanded data frame that lie before the first observed point. Defaults to FALSE. This is done based on the sort_col and group_col, if provided.

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".

sort_descending

Logical value on whether the sorted values from sort_col should be sorted in descending order. Defaults to FALSE.

group_col

Column name(s) of group(s) to use in dplyr::group_by() when supplying type, calculating mean absolute scaled error on data involving time series, and if group_models, then fitting and predicting models too. If NULL, not used. Defaults to "iso3".

Value

Filtered expanded data frame.


caldwellst/augury documentation built on Oct. 10, 2024, 8:20 a.m.