Skip to content

Commit 6ad35d5

Browse files
brookslogandsweber2
authored andcommitted
Iterate on archive R6 docs
1 parent 8ab224d commit 6ad35d5

File tree

2 files changed

+44
-22
lines changed

2 files changed

+44
-22
lines changed

R/archive.R

+27-7
Original file line numberDiff line numberDiff line change
@@ -217,21 +217,22 @@ epi_archive <-
217217
#####
218218
public = list(
219219
#' @field DT (`data.table`)\cr
220-
#' the compressed datatable
220+
#' the (optionally compactified) datatable
221221
DT = NULL,
222-
#' @field geo_type (`character()`)\cr
222+
#' @field geo_type (string)\cr
223223
#' the resolution of the geographic label (e.g. state)
224224
geo_type = NULL,
225-
#' @field time_type (`character()`)\cr
225+
#' @field time_type (string)\cr
226226
#' the resolution of the time column (e.g. day)
227227
time_type = NULL,
228-
#' @field additional_metadata (`list()`)\cr
228+
#' @field additional_metadata (named list)\cr
229229
#' any extra fields, such as `other_keys`
230230
additional_metadata = NULL,
231-
#' @field clobberable_versions_start (`Date()`)\cr
232-
#' the earliest date that new data should overwrite existing data
231+
#' @field clobberable_versions_start (length-1 of same type&class as `version` column, or `NA`)\cr
232+
#' the earliest version number that might be rewritten in the future without assigning a new version
233+
#' date/number, or `NA` if this won't happen
233234
clobberable_versions_start = NULL,
234-
#' @field versions_end (`Date()`)\cr
235+
#' @field versions_end (length-1 of same type&class as `version` column)\cr
235236
#' the latest version observed
236237
versions_end = NULL,
237238
#' @description Creates a new `epi_archive` object.
@@ -438,6 +439,10 @@ epi_archive <-
438439
self$clobberable_versions_start <- clobberable_versions_start
439440
self$versions_end <- versions_end
440441
},
442+
#' Print information about an archive
443+
#' @param class Boolean; whether to print the class label header
444+
#' @param methods Boolean; whether to print all available methods of
445+
#' the archive
441446
print = function(class = TRUE, methods = TRUE) {
442447
if (class) cat("An `epi_archive` object, with metadata:\n")
443448
cat(sprintf("* %-9s = %s\n", "geo_type", self$geo_type))
@@ -500,6 +505,21 @@ epi_archive <-
500505
#####
501506
#' @description Generates a snapshot in `epi_df` format as of a given version.
502507
#' See the documentation for the wrapper function [`epix_as_of()`] for details.
508+
#' @param x An `epi_archive` object
509+
#' @param max_version Version specifying the max version to permit in the
510+
#' snapshot. That is, the snapshot will comprise the unique rows of the
511+
#' current archive data that represent the most up-to-date signal values, as
512+
#' of the specified `max_version` (and whose `time_value`s are at least
513+
#' `min_time_value`).
514+
#' @param min_time_value Time value specifying the min `time_value` to permit in
515+
#' the snapshot. Default is `-Inf`, which effectively means that there is no
516+
#' minimum considered.
517+
#' @param all_versions Boolean; If `all_versions = TRUE`, then the output will be in
518+
#' `epi_archive` format, and contain rows in the specified `time_value` range
519+
#' having `version <= max_version`. The resulting object will cover a
520+
#' potentially narrower `version` and `time_value` range than `x`, depending
521+
#' on user-provided arguments. Otherwise, there will be one row in the output
522+
#' for the `max_version` of each `time_value`. Default is `FALSE`.
503523
#' @importFrom data.table between key
504524
as_of = function(max_version, min_time_value = -Inf, all_versions = FALSE) {
505525
# Self max version and other keys

man/epi_archive.Rd

+17-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)