Skip to content

Commit 65a49da

Browse files
documentation improvements and clarifications
Co-authored-by: brookslogan <lcbrooks@cs.cmu.edu>
1 parent 43ce902 commit 65a49da

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

R/methods-epi_archive.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,10 +661,10 @@ group_by.epi_archive = function(.data, ..., .add=FALSE, .drop=dplyr::group_by_dr
661661
#' column names as the archive's `DT`, minus the `version` column; followed
662662
#' by a one-row tibble containing the values of the grouping variables for
663663
#' the associated group; followed by a Date containing the reference time
664-
#' value to use; followed by any number of named arguments. If a formula,
665-
#' `f` can operate directly on columns accessed via `.x$var` or `.`, as in
664+
#' value that was used; followed by any number of named arguments. If a formula,
665+
#' `f` can operate directly on columns accessed via `.x$var` or `.$var`, as in
666666
#' `~ mean (.x$var)` to compute a mean of a column `var` for each
667-
#' `ref_time_value`-group combination. The group key can be accessed via
667+
#' group-`ref_time_value` combination. The group key can be accessed via
668668
#' `.y` or `.group_key`, and the reference time value can be accessed via
669669
#' `.z` or `.ref_time_value`. If `f` is missing, then `...` will specify
670670
#' the computation.

R/slide.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#' step is typically one day or one week; see details for more explanation. If
1515
#' a function, `f` must take a data frame with the same column names as
1616
#' the original object, minus any grouping variables, containing the time
17-
#' window data for one `ref_time_value`-group combination; followed by a
17+
#' window data for one group-`ref_time_value` combination; followed by a
1818
#' one-row tibble containing the values of the grouping variables for the
1919
#' associated group; followed by any number of named arguments. If a formula,
2020
#' `f` can operate directly on columns accessed via `.x$var` or `.$var`, as

R/utils.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,21 @@ assert_sufficient_f_args <- function(f, ..., n_mandatory_f_args = 2L) {
190190
#' This powers the lambda syntax in packages like purrr.
191191
#'
192192
#' This is an extension of `rlang::as_function` that can create functions that
193-
#' take three arguments. The arugments can be accessed via the idiomatic
193+
#' take three arguments. The arguments can be accessed via the idiomatic
194194
#' `.x`, `.y`, etc, positional references (`..1`, `..2`, etc), and also by
195195
#' `slide`-specific names.
196196
#'
197197
#' @param x A function or formula.
198198
#'
199199
#' If a **function**, it is used as is.
200200
#'
201-
#' If a **formula**, e.g. `~ .x + 2`, it is converted to a function with up
201+
#' If a **formula**, e.g. `~ mean(.x$cases)`, it is converted to a function with up
202202
#' to three arguments: `.x` (single argument), or `.x` and `.y`
203203
#' (two arguments), or `.x`, `.y`, and `.z` (three arguments). The `.`
204204
#' placeholder can be used instead of `.x`, `.group_key` can be used in
205205
#' place of `.y`, and `.ref_time_value` can be used in place of `.z`. This
206206
#' allows you to create very compact anonymous functions (lambdas) with up
207-
#' to two inputs. Functions created from formulas have a special class. Use
207+
#' to three inputs. Functions created from formulas have a special class. Use
208208
#' `rlang::is_lambda()` to test for it.
209209
#'
210210
#' If a **string**, the function is looked up in `env`. Note that

0 commit comments

Comments
 (0)