Skip to content

Commit 468bfc0

Browse files
committed
drop arg specifying number of args to expect
1 parent 62da4d5 commit 468bfc0

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

R/grouped_epi_archive.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ grouped_epi_archive =
232232

233233
# Check that `f` takes enough args
234234
if (!missing(f) && is.function(f)) {
235-
assert_sufficient_f_args(f, ..., n_mandatory_f_args = 3L)
235+
assert_sufficient_f_args(f, ...)
236236
}
237237

238238
# Validate and pre-process `before`:

R/slide.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ epi_slide = function(x, f, ..., before, after, ref_time_values,
170170

171171
# Check that `f` takes enough args
172172
if (!missing(f) && is.function(f)) {
173-
assert_sufficient_f_args(f, ..., n_mandatory_f_args = 3L)
173+
assert_sufficient_f_args(f, ...)
174174
}
175175

176176
if (missing(ref_time_values)) {

R/utils.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,14 @@ Warn = function(msg, ...) rlang::warn(break_str(msg, init = "Warning: "), ...)
106106
#' `epi_archive` in `epi_slide` or `epix_slide`.
107107
#' @param ... Dots that will be forwarded to `f` from the dots of `epi_slide` or
108108
#' `epix_slide`.
109-
#' @param n_mandatory_f_args Integer; specifies the number of arguments `f`
110-
#' is required to take before any `...` arg. Defaults to 2.
111109
#'
112110
#' @importFrom rlang is_missing
113111
#' @importFrom purrr map_lgl
114112
#' @importFrom utils tail
115113
#'
116114
#' @noRd
117-
assert_sufficient_f_args <- function(f, ..., n_mandatory_f_args = 2L) {
118-
mandatory_f_args_labels <- c("window data", "group key", "reference time value")[seq(n_mandatory_f_args)]
115+
assert_sufficient_f_args <- function(f, ...) {
116+
mandatory_f_args_labels <- c("window data", "group key", "reference time value")
119117
n_mandatory_f_args <- length(mandatory_f_args_labels)
120118
args = formals(args(f))
121119
args_names = names(args)

0 commit comments

Comments
 (0)