Skip to content

Commit 03bf732

Browse files
committed
docs(epi_slide_opt desc): cast as main time slide, +NA behavior, edits
1 parent 4a3eafc commit 03bf732

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

R/slide.R

+15-5
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,22 @@ get_before_after_from_window <- function(window_size, align, time_type) {
573573
list(before = before, after = after)
574574
}
575575

576-
#' Optimized slide functions for common cases
576+
#' Calculate rolling or running means, sums, etc., or custom calculations
577577
#'
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.
582592
#'
583593
#' @template basic-slide-params
584594
#' @param .col_names <[`tidy-select`][dplyr_tidy_select]> An unquoted column

man/epi_slide_opt.Rd

+15-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)