Skip to contents

Sometimes, due to upstream data pipeline issues, we have to work with a version history that isn't completely up to date, but with functions that expect archives that are completely up to date, or equally as up-to-date as another archive. This function provides one way to approach such mismatches: pretend that we've "observed" additional versions, filling in these versions with NAs or extrapolated values.

Usage

epix_fill_through_version(x, fill_versions_end, how = c("na", "locf"))

Arguments

x

An epi_archive

fill_versions_end

Length-1, same class&type as x$version: the version through which to fill in missing version history; this will be the result's $versions_end unless it already had a later $versions_end.

how

Optional; "na" or "locf": "na" will fill in any missing required version history with NAs, by inserting (if necessary) an update immediately after the current $versions_end that revises all existing measurements to be NA (this is only supported for version classes with a next_after implementation); "locf" will fill in missing version history with the last version of each observation carried forward (LOCF), by leaving the update $DT alone (other epi_archive methods are based on LOCF). Default is "na".

Value

An epi_archive