@@ -573,12 +573,22 @@ get_before_after_from_window <- function(window_size, align, time_type) {
573
573
list (before = before , after = after )
574
574
}
575
575
576
- # ' Optimized slide functions for common cases
576
+ # ' Calculate rolling or running means, sums, etc., or custom calculations
577
577
# '
578
- # ' @description `epi_slide_opt` allows sliding an n-timestep [data.table::froll]
579
- # ' or [slider::summary-slide] function over variables in an `epi_df` object.
580
- # ' These functions tend to be much faster than `epi_slide()`. See
581
- # ' `vignette("epi_df")` for more examples.
578
+ # ' @description These methods take each subpopulation (i.e., a single
579
+ # ' `geo_value` and combination of any `other_keys` you set up for age groups,
580
+ # ' etc.) and perform a `.window_size`-width time window rolling/sliding
581
+ # ' computation, or alternatively, a running/cumulative computation (with
582
+ # ' `.window_size = Inf`) on the requested columns. Explicit `NA` measurements
583
+ # ' are temporarily added to fill in any time gaps, and, for rolling
584
+ # ' computations, to pad the time series to ensure that the first & last
585
+ # ' computations are over exactly `.window_size` values.
586
+ # '
587
+ # ' `epi_slide_opt` allows you to use any [data.table::froll] or
588
+ # ' [slider::summary-slide] function. If none of the specialized functions here
589
+ # ' work, you can use `data.table::frollapply` with your own function. See
590
+ # ' [`epi_slide`] if you need to work with multiple columns at once or output a
591
+ # ' custom type.
582
592
# '
583
593
# ' @template basic-slide-params
584
594
# ' @param .col_names <[`tidy-select`][dplyr_tidy_select]> An unquoted column
0 commit comments