View source: R/methods-epi_archive.R
epix_as_of | R Documentation |
epi_archive
objectGenerates a snapshot in epi_df
format from an epi_archive
object, as of a
given version. See the archive vignette for
examples.
epix_as_of(
x,
version,
min_time_value = -Inf,
all_versions = FALSE,
max_version = deprecated()
)
x |
An |
version |
Time value specifying the max version to permit in the
snapshot. That is, the snapshot will comprise the unique rows of the
current archive data that represent the most up-to-date signal values, as
of the specified |
min_time_value |
Time value specifying the min time value to permit in
the snapshot. Default is |
all_versions |
If |
max_version |
An epi_df
object.
epix_as_of(
archive_cases_dv_subset,
version = max(archive_cases_dv_subset$DT$version)
)
range(archive_cases_dv_subset$DT$version) # 2020-06-02 -- 2021-12-01
epix_as_of(archive_cases_dv_subset, as.Date("2020-06-12"))
# --- Advanced: ---
# When requesting recent versions of a data set, there can be some
# reproducibility issues. For example, requesting data as of the current date
# may return different values based on whether today's data is available yet
# or not. Other factors include the time it takes between data becoming
# available and when you download the data, and whether the data provider
# will overwrite ("clobber") version data rather than just publishing new
# versions. You can include information about these factors by setting the
# `clobberable_versions_start` and `versions_end` of an `epi_archive`, in
# which case you will get warnings about potential reproducibility issues:
archive_cases_dv_subset2 <- as_epi_archive(
archive_cases_dv_subset$DT,
# Suppose last version with an update could potentially be rewritten
# (a.k.a. "hotfixed", "clobbered", etc.):
clobberable_versions_start = max(archive_cases_dv_subset$DT$version),
# Suppose today is the following day, and there are no updates out yet:
versions_end = max(archive_cases_dv_subset$DT$version) + 1L,
compactify = TRUE
)
epix_as_of(archive_cases_dv_subset2, max(archive_cases_dv_subset$DT$version))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.