@@ -806,31 +806,53 @@ group_by.epi_archive = function(.data, ..., .add=FALSE, .drop=dplyr::group_by_dr
806806# ' # 2 `time_value`s, for the rest of the results
807807# ' # never 3 `time_value`s, due to data latency
808808# '
809- # '
809+ # ' # Examining characteristics of the data passed to each computation with
810+ # ' # `all_versions=FALSE`.
811+ # ' archive_cases_dv_subset %>%
812+ # ' group_by(geo_value) %>%
813+ # ' epix_slide(
814+ # ' function(x, g) {
815+ # ' tibble(
816+ # ' time_range = if(nrow(x) == 0L) {
817+ # ' "0 `time_value`s"
818+ # ' } else {
819+ # ' sprintf("%s -- %s", min(x$time_value), max(x$time_value))
820+ # ' },
821+ # ' n = nrow(x),
822+ # ' class1 = class(x)[[1L]]
823+ # ' )
824+ # ' },
825+ # ' before = 5, all_versions = FALSE,
826+ # ' ref_time_values = ref_time_values, names_sep=NULL) %>%
827+ # ' ungroup() %>%
828+ # ' arrange(geo_value, time_value)
810829# '
811830# ' # --- Advanced: ---
812831# '
813832# ' # `epix_slide` with `all_versions=FALSE` (the default) applies a
814833# ' # version-unaware computation to several versions of the data. We can also
815834# ' # use `all_versions=TRUE` to apply a version-*aware* computation to several
816- # ' # versions of the data. In this case, each computation should expect an
835+ # ' # versions of the data, again looking at characteristics of the data passed
836+ # ' # to each computation. In this case, each computation should expect an
817837# ' # `epi_archive` containing the relevant version data:
818838# '
819839# ' archive_cases_dv_subset %>%
820840# ' group_by(geo_value) %>%
821841# ' epix_slide(
822842# ' function(x, g) {
823843# ' tibble(
844+ # ' versions_start = min(x$DT$version),
824845# ' versions_end = max(x$versions_end),
825846# ' time_range = if(nrow(x$DT) == 0L) {
826847# ' "0 `time_value`s"
827848# ' } else {
828849# ' sprintf("%s -- %s", min(x$DT$time_value), max(x$DT$time_value))
829850# ' },
851+ # ' n = nrow(x$DT),
830852# ' class1 = class(x)[[1L]]
831853# ' )
832854# ' },
833- # ' before = 2 , all_versions = TRUE,
855+ # ' before = 5 , all_versions = TRUE,
834856# ' ref_time_values = ref_time_values, names_sep=NULL) %>%
835857# ' ungroup() %>%
836858# ' arrange(geo_value, time_value)
0 commit comments