@@ -230,15 +230,12 @@ next_after.Date <- function(x) x + 1L
230
230
# ' value of `clobberable_versions_start` does not fully trust these empty
231
231
# ' updates, and assumes that any version `>= max(x$version)` could be
232
232
# ' clobbered.) If `nrow(x) == 0`, then this argument is mandatory.
233
- # ' @return An `epi_archive` object.
233
+ # ' @return * Of `new_epi_archive`: an (unvalidated) `epi_archive`
234
234
# '
235
235
# ' @seealso [`epix_as_of`] [`epix_merge`] [`epix_slide`]
236
236
# ' @importFrom dplyr if_any if_all everything
237
237
# ' @importFrom utils capture.output
238
238
# '
239
- # ' @name epi_archive
240
- # ' @export
241
- # '
242
239
# ' @examples
243
240
# ' # Simple ex. with necessary keys
244
241
# ' tib <- tibble::tibble(
@@ -277,6 +274,9 @@ next_after.Date <- function(x) x + 1L
277
274
# '
278
275
# ' x <- df %>% as_epi_archive(other_keys = "county")
279
276
# '
277
+ # ' @name epi_archive
278
+ # ' @order 3
279
+ # ' @export
280
280
new_epi_archive <- function (
281
281
x ,
282
282
geo_type ,
@@ -329,7 +329,11 @@ new_epi_archive <- function(
329
329
330
330
# ' Perform second (costly) round of validation that `x` is a proper `epi_archive`
331
331
# '
332
+ # ' @return * Of `validate_epi_archive`: an `epi_archive`,
333
+ # ' [invisibly][base::invisible] (or raises an error if `x` was invalid)
334
+ # '
332
335
# ' @rdname epi_archive
336
+ # ' @order 4
333
337
# ' @export
334
338
validate_epi_archive <- function (x ) {
335
339
assert_class(x , " epi_archive" )
@@ -515,8 +519,10 @@ is_locf <- function(vec, abs_tol, is_key) { # nolint: object_usage_linter
515
519
# ' @param .versions_end location based versions_end, used to avoid prefix
516
520
# ' `version = issue` from being assigned to `versions_end` instead of being
517
521
# ' used to rename columns.
522
+ # ' @return * Of `as_epi_archive`: an `epi_archive` object
518
523
# '
519
524
# ' @rdname epi_archive
525
+ # ' @order 1
520
526
# '
521
527
# ' @export
522
528
as_epi_archive <- function (
@@ -808,3 +814,16 @@ clone.epi_archive <- function(x) {
808
814
x $ DT <- data.table :: copy(x $ DT )
809
815
x
810
816
}
817
+
818
+ # ' Test for `epi_archive` format
819
+ # '
820
+ # ' @param x An object.
821
+ # ' @return * Of `is_epi_archive`: `TRUE` if the object inherits from `epi_archive`,
822
+ # ' otherwise `FALSE`.
823
+ # '
824
+ # ' @rdname epi_archive
825
+ # ' @order 2
826
+ # ' @export
827
+ is_epi_archive <- function (x ) {
828
+ inherits(x , " epi_archive" )
829
+ }
0 commit comments