fill_na: fill missing values in the data of a pollyvote object

Description Usage Arguments Value

Description

internal function that handles missing values in the data frame of a pollyvote object. Different error handling arguments can be handed over.

Usage

1
2
fill_na(dat, na_handle = c("last", "omit", "mean_within", "mean_across"),
  pv = NULL, time_int = NULL, ...)

Arguments

dat

[data.frame()]
data frame of a pollyvote object.

na_handle

[character(1)]
character describing which method is used to fill missing values. Currently supported is

  • 'last': Use the last available value. Fill all days between the earliest and latest day in the data.

  • 'omit': For every day, agregate available data.

  • 'mean_within' Use the available data of this subcomponent to fill missing values.

  • 'mean_across' Create a mini-pollyvote prediction by aggregating all source_types using na_handle = 'last' and then aggregating the result using na_handle = 'last', which will then be used to predict missing values in the lowest aggregation level.

pv

[pollyvote]
only required for na_handle = 'mean_across', the pollyvote object containing the data frame.

...

[list()]
additional arguments, currently ignored.

Value

the data set with filled mssing values.


pollyvote/pollyvoter documentation built on May 25, 2019, 11:23 a.m.