@@ -806,31 +806,53 @@ group_by.epi_archive = function(.data, ..., .add=FALSE, .drop=dplyr::group_by_dr
806
806
# ' # 2 `time_value`s, for the rest of the results
807
807
# ' # never 3 `time_value`s, due to data latency
808
808
# '
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)
810
829
# '
811
830
# ' # --- Advanced: ---
812
831
# '
813
832
# ' # `epix_slide` with `all_versions=FALSE` (the default) applies a
814
833
# ' # version-unaware computation to several versions of the data. We can also
815
834
# ' # 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
817
837
# ' # `epi_archive` containing the relevant version data:
818
838
# '
819
839
# ' archive_cases_dv_subset %>%
820
840
# ' group_by(geo_value) %>%
821
841
# ' epix_slide(
822
842
# ' function(x, g) {
823
843
# ' tibble(
844
+ # ' versions_start = min(x$DT$version),
824
845
# ' versions_end = max(x$versions_end),
825
846
# ' time_range = if(nrow(x$DT) == 0L) {
826
847
# ' "0 `time_value`s"
827
848
# ' } else {
828
849
# ' sprintf("%s -- %s", min(x$DT$time_value), max(x$DT$time_value))
829
850
# ' },
851
+ # ' n = nrow(x$DT),
830
852
# ' class1 = class(x)[[1L]]
831
853
# ' )
832
854
# ' },
833
- # ' before = 2 , all_versions = TRUE,
855
+ # ' before = 5 , all_versions = TRUE,
834
856
# ' ref_time_values = ref_time_values, names_sep=NULL) %>%
835
857
# ' ungroup() %>%
836
858
# ' arrange(geo_value, time_value)
0 commit comments