@@ -217,21 +217,22 @@ epi_archive <-
217
217
# ####
218
218
public = list (
219
219
# ' @field DT (`data.table`)\cr
220
- # ' the compressed datatable
220
+ # ' the (optionally compactified) datatable
221
221
DT = NULL ,
222
- # ' @field geo_type (`character()` )\cr
222
+ # ' @field geo_type (string )\cr
223
223
# ' the resolution of the geographic label (e.g. state)
224
224
geo_type = NULL ,
225
- # ' @field time_type (`character()` )\cr
225
+ # ' @field time_type (string )\cr
226
226
# ' the resolution of the time column (e.g. day)
227
227
time_type = NULL ,
228
- # ' @field additional_metadata (` list()` )\cr
228
+ # ' @field additional_metadata (named list)\cr
229
229
# ' any extra fields, such as `other_keys`
230
230
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
233
234
clobberable_versions_start = NULL ,
234
- # ' @field versions_end (`Date()` )\cr
235
+ # ' @field versions_end (length-1 of same type&class as `version` column )\cr
235
236
# ' the latest version observed
236
237
versions_end = NULL ,
237
238
# ' @description Creates a new `epi_archive` object.
@@ -438,6 +439,10 @@ epi_archive <-
438
439
self $ clobberable_versions_start <- clobberable_versions_start
439
440
self $ versions_end <- versions_end
440
441
},
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
441
446
print = function (class = TRUE , methods = TRUE ) {
442
447
if (class ) cat(" An `epi_archive` object, with metadata:\n " )
443
448
cat(sprintf(" * %-9s = %s\n " , " geo_type" , self $ geo_type ))
@@ -500,6 +505,21 @@ epi_archive <-
500
505
# ####
501
506
# ' @description Generates a snapshot in `epi_df` format as of a given version.
502
507
# ' 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`.
503
523
# ' @importFrom data.table between key
504
524
as_of = function (max_version , min_time_value = - Inf , all_versions = FALSE ) {
505
525
# Self max version and other keys
0 commit comments