Skip to content

Commit 30ff151

Browse files
committed
comments
1 parent 0666c8a commit 30ff151

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

R/grouped_epi_archive.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ grouped_epi_archive =
292292
!!new_col := .env$comp_value))
293293
}
294294

295-
# Interpret ... as an expression for tidy evaluation
295+
# If `f` is missing, interpret ... as an expression for tidy evaluation
296296
if (missing(f)) {
297297
quos = enquos(...)
298298
if (length(quos) == 0) {

R/slide.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ epi_slide = function(x, f, ..., before, after, ref_time_values,
351351
return(mutate(.data_group, !!new_col := slide_values))
352352
}
353353

354-
# Interpret ... as an expression for tidy evaluation
354+
# If `f` is missing, interpret ... as an expression for tidy evaluation
355355
if (missing(f)) {
356356
quos = enquos(...)
357357
if (length(quos) == 0) {

R/utils.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ assert_sufficient_f_args <- function(f, ...) {
215215
#' scoping issues involved. Package developers should avoid
216216
#' supplying functions by name and instead supply them by value.
217217
#'
218+
#' @param before how far `before` each `ref_time_value` the sliding window
219+
#' should extend, as specified in the parent `epi[x]_slide` call Must be a
220+
#' single, non-`NA`, non-negative,[integer-compatible]
221+
#' [vctrs::vec_cast] number of time steps. Used only when
222+
#' `calc_ref_time_value` is `TRUE`
218223
#' @param calc_ref_time_value Boolean indicating whether the computation
219224
#' function should include a step to calculate `ref_time_value` based on the
220225
#' contents of the group data `.x`. This is used in `epi_slide`. When this
@@ -244,8 +249,8 @@ assert_sufficient_f_args <- function(f, ...) {
244249
#'
245250
#' @noRd
246251
as_slide_computation <- function(x,
247-
calc_ref_time_value = FALSE,
248252
before,
253+
calc_ref_time_value = FALSE,
249254
env = global_env(),
250255
...,
251256
arg = caller_arg(x),
@@ -261,8 +266,7 @@ as_slide_computation <- function(x,
261266
data_env = rlang::as_environment(.x)
262267
data_mask = rlang::new_data_mask(bottom = data_env, top = data_env)
263268
data_mask$.data <- rlang::as_data_pronoun(data_mask)
264-
# We'll also install `.x` directly, not as an `rlang_data_pronoun`, so
265-
# that we can, e.g., use more dplyr and epiprocess operations.
269+
# Also install `.x` directly.
266270
data_mask$.x = .x
267271
data_mask$.group_key = .group_key
268272
data_mask$.ref_time_value = .ref_time_value

0 commit comments

Comments
 (0)