add_horizon: Add missing values for future dates

View source: R/preprocessing.R

add_horizonR Documentation

Add missing values for future dates

Description

Add missing values for future dates

Usage

add_horizon(data, horizon, accumulate = 1L, obs_column = "confirm", by = NULL)

Arguments

data

Data frame with a date column. The other columns depend on the model that the data are to be used, e.g. estimate_infections() or estimate_secondary(). See the documentation there for the expected format.

horizon

Deprecated; use forecast instead to specify the predictive horizon

accumulate

The number of days to accumulate when generating posterior prediction, e.g. 7 for weekly accumulated forecasts.

obs_column

Character (default: "confirm"). If given, only the column specified here will be used for checking missingness. This is useful if using a data set that has multiple columns of hwich one of them corresponds to observations that are to be processed here.

by

Character vector. Name(s) of any additional column(s) where data processing should be done separately for each value in the column. This is useful when using data representing e.g. multiple geographies. If NULL (default) no such grouping is done.

Value

A data.table with missing values for future dates


epiforecasts/EpiNow2 documentation built on Dec. 20, 2024, 10:12 p.m.