@@ -58,7 +58,10 @@ arx_classifier <- function(
58
58
if (args_list $ adjust_latency == " none" ) {
59
59
forecast_date_default <- max(epi_data $ time_value )
60
60
if (! is.null(args_list $ forecast_date ) && args_list $ forecast_date != forecast_date_default ) {
61
- cli_warn(" The specified forecast date {args_list$forecast_date} doesn't match the date from which the forecast is occurring {forecast_date}." )
61
+ cli_warn(
62
+ " The specified forecast date {args_list$forecast_date} doesn't match the
63
+ date from which the forecast is occurring {forecast_date}."
64
+ )
62
65
}
63
66
} else {
64
67
forecast_date_default <- attributes(epi_data )$ metadata $ as_of
@@ -101,7 +104,7 @@ arx_classifier <- function(
101
104
# '
102
105
# ' @return An unfit `epi_workflow`.
103
106
# ' @export
104
- # ' @seealso [arx_classifier()]
107
+ # ' @seealso [arx_classifier()] [arx_class_args_list()]
105
108
# ' @examples
106
109
# ' library(dplyr)
107
110
# ' jhu <- covid_case_death_rates %>%
@@ -154,12 +157,13 @@ arx_class_epi_workflow <- function(
154
157
role = " grp" ,
155
158
horizon = args_list $ horizon ,
156
159
method = args_list $ method ,
157
- log_scale = args_list $ log_scale ,
158
- additional_gr_args_list = args_list $ additional_gr_args
160
+ log_scale = args_list $ log_scale
159
161
)
160
162
for (l in seq_along(lags )) {
161
163
pred_names <- predictors [l ]
162
- pred_names <- as.character(glue :: glue_data(args_list , " gr_{horizon}_{method}_{pred_names}" ))
164
+ pred_names <- as.character(glue :: glue_data(
165
+ args_list , " gr_{horizon}_{method}_{pred_names}"
166
+ ))
163
167
r <- step_epi_lag(r , !! pred_names , lag = lags [[l ]])
164
168
}
165
169
# ------- outcome
@@ -185,8 +189,7 @@ arx_class_epi_workflow <- function(
185
189
role = " pre-outcome" ,
186
190
horizon = args_list $ horizon ,
187
191
method = args_list $ method ,
188
- log_scale = args_list $ log_scale ,
189
- additional_gr_args_list = args_list $ additional_gr_args
192
+ log_scale = args_list $ log_scale
190
193
)
191
194
}
192
195
}
@@ -270,9 +273,6 @@ arx_class_epi_workflow <- function(
270
273
# ' @param method Character. Options available for growth rate calculation.
271
274
# ' @param log_scale Scalar logical. Whether to compute growth rates on the
272
275
# ' log scale.
273
- # ' @param additional_gr_args List. Optional arguments controlling growth rate
274
- # ' calculation. See [epiprocess::growth_rate()] and the related Vignette for
275
- # ' more details.
276
276
# ' @param check_enough_data_n Integer. A lower limit for the number of rows per
277
277
# ' epi_key that are required for training. If `NULL`, this check is ignored.
278
278
# ' @param check_enough_data_epi_keys Character vector. A character vector of
@@ -301,7 +301,6 @@ arx_class_args_list <- function(
301
301
horizon = 7L ,
302
302
method = c(" rel_change" , " linear_reg" ),
303
303
log_scale = FALSE ,
304
- additional_gr_args = list (),
305
304
check_enough_data_n = NULL ,
306
305
check_enough_data_epi_keys = NULL ,
307
306
... ) {
@@ -320,23 +319,14 @@ arx_class_args_list <- function(
320
319
arg_is_lgl(log_scale )
321
320
arg_is_pos(n_training )
322
321
if (is.finite(n_training )) arg_is_pos_int(n_training )
323
- if (! is.list(additional_gr_args )) {
324
- cli_abort(c(
325
- " `additional_gr_args` must be a {.cls list}." ,
326
- " !" = " This is a {.cls {class(additional_gr_args)}}." ,
327
- i = " See `?epiprocess::growth_rate` for available arguments."
328
- ))
329
- }
330
322
arg_is_pos(check_enough_data_n , allow_null = TRUE )
331
323
arg_is_chr(check_enough_data_epi_keys , allow_null = TRUE )
332
324
333
325
if (! is.null(forecast_date ) && ! is.null(target_date )) {
334
326
if (forecast_date + ahead != target_date ) {
335
327
cli_warn(
336
- paste0(
337
- " `forecast_date` {.val {forecast_date}} +" ,
338
- " `ahead` {.val {ahead}} must equal `target_date` {.val {target_date}}."
339
- ),
328
+ " `forecast_date` {.val {forecast_date}} +
329
+ `ahead` {.val {ahead}} must equal `target_date` {.val {target_date}}." ,
340
330
class = " epipredict__arx_args__inconsistent_target_ahead_forecaste_date"
341
331
)
342
332
}
@@ -362,7 +352,6 @@ arx_class_args_list <- function(
362
352
horizon ,
363
353
method ,
364
354
log_scale ,
365
- additional_gr_args ,
366
355
check_enough_data_n ,
367
356
check_enough_data_epi_keys
368
357
),
0 commit comments