@@ -358,10 +358,21 @@ epix_merge = function(x, y,
358
358
# ' @param ... Additional arguments to pass to the function or formula specified
359
359
# ' via `f`. Alternatively, if `f` is missing, then the current argument is
360
360
# ' interpreted as an expression for tidy evaluation.
361
- # ' @param before Number of time steps to use in the running window. For example,
362
- # ' if `before = 7`, and one time step is one day, then to produce a value on
363
- # ' January 7 we apply the given function or formula to data in between January
364
- # ' 1 and 7.
361
+ # ' @param before How far `before` each `ref_time_value` should the sliding
362
+ # ' window extend? If provided, should be a single, non-NA,
363
+ # ' [integer-compatible][vctrs::vec_cast] number of time steps. This window
364
+ # ' endpoint is inclusive. For example, if `before = 7`, and one time step is
365
+ # ' one day, then to produce a value for a `ref_time_value` of January 8, we
366
+ # ' apply the given function or formula to data (for each group present) with
367
+ # ' `time_value`s from January 1 onward, as they were reported on January 8.
368
+ # ' For typical disease surveillance sources, this will not include any data
369
+ # ' with a `time_value` of January 8, and, depending on the amount of reporting
370
+ # ' latency, may not include January 7 or even earlier `time_value`s. (If
371
+ # ' instead the archive were to hold nowcasts instead of regular surveillance
372
+ # ' data, then we would indeed expect data for `time_value` January 8. If it
373
+ # ' were to hold forecasts, then we would expect data for `time_value`s after
374
+ # ' January 8, and the sliding window would extend as far after each
375
+ # ' `ref_time_value` as needed to include all such `time_value`s.)
365
376
# ' @param group_by The variable(s) to group by before slide computation. If
366
377
# ' missing, then the keys in the underlying data table, excluding `time_value`
367
378
# ' and `version`, will be used for grouping. To omit a grouping entirely, use
@@ -396,10 +407,14 @@ epix_merge = function(x, y,
396
407
# ' values.
397
408
# '
398
409
# ' @details Two key distinctions between inputs to the current function and
399
- # ' `epi_slide()`:
400
- # ' 1. `epix_slide()` uses windows that are **always right-aligned** (in
401
- # ' `epi_slide()`, custom alignments could be specified using the `align` or
402
- # ' `before` arguments).
410
+ # ' [`epi_slide()`]:
411
+ # ' 1. `epix_slide()` doesn't accept an `after` argument; its windows extend
412
+ # ' from `before` time steps before a given `ref_time_value` through the last
413
+ # ' `time_value` available as of version `ref_time_value` (typically, this
414
+ # ' won't include `ref_time_value` itself, as observations about a particular
415
+ # ' time interval (e.g., day) are only published after that time interval ends);
416
+ # ' `epi_slide` windows extend from `before` time steps before a
417
+ # ' `ref_time_value` through `after` time steps after `ref_time_value`.
403
418
# ' 2. `epix_slide()` uses a `group_by` to specify the grouping upfront (in
404
419
# ' `epi_slide()`, this would be accomplished by a preceding function call to
405
420
# ' `dplyr::group_by()`).
0 commit comments