latest_obs: Filter for latest observations of all types

View source: R/preprocess.R

latest_obsR Documentation

Filter for latest observations of all types

Description

Filter for latest observations of all types

Usage

latest_obs(obs)

Arguments

obs

A data.frame with the following variables: date, cases, seq_voc, and seq_total, cases_available, and seq_available. seq_available and case_available must be uniquely define data rows but other rows can be duplicated based on data availability. This data format allows for multiple versions of case and sequence data for a given date with different reporting dates. This is important when using the package in evaluation settings or in real-time where data sources are liable to be updated as new data becomes available. See germany_covid19_delta_obs for an example of a supported data set.

Value

A data.frame of observations filtered for the latest available data.

See Also

Preprocessing functions filter_by_availability(), fv_dow_period(), piecewise_steps()

Examples

dt <- rbind(
  update_obs_availability(germany_covid19_delta_obs, seq_lag = 3),
  update_obs_availability(germany_covid19_delta_obs, seq_lag = 1)
)
latest_obs(dt)

epiforecasts/forecast.vocs documentation built on May 14, 2023, 2 p.m.