@@ -139,7 +139,6 @@ step_epi_slide_new <-
139
139
140
140
# ' @export
141
141
prep.step_epi_slide <- function (x , training , info = NULL , ... ) {
142
-
143
142
col_names <- recipes :: recipes_eval_select(x $ terms , data = training , info = info )
144
143
145
144
check_type(training [, col_names ], types = c(" double" , " integer" ))
@@ -164,7 +163,6 @@ prep.step_epi_slide <- function(x, training, info = NULL, ...) {
164
163
165
164
# ' @export
166
165
bake.step_epi_slide <- function (object , new_data , ... ) {
167
-
168
166
recipes :: check_new_data(names(object $ columns ), object , new_data )
169
167
col_names <- object $ columns
170
168
name_prefix <- paste0(object $ prefix , object $ f_name , " _" )
@@ -176,7 +174,8 @@ bake.step_epi_slide <- function(object, new_data, ...) {
176
174
nms <- new_data_names [intersection ]
177
175
cli_abort(
178
176
c(" Name collision occured. The following variable names already exist:" ,
179
- `*` = " {.var {nms}}" ),
177
+ `*` = " {.var {nms}}"
178
+ ),
180
179
call = caller_env()
181
180
)
182
181
}
@@ -191,7 +190,8 @@ bake.step_epi_slide <- function(object, new_data, ...) {
191
190
dplyr :: across(
192
191
dplyr :: all_of(object $ columns ),
193
192
~ slider :: slide_index_vec(
194
- .x , .i = time_value ,
193
+ .x ,
194
+ .i = time_value ,
195
195
object $ .f , .before = object $ before , .after = object $ after
196
196
)
197
197
)
@@ -270,7 +270,7 @@ validate_slide_fun <- function(.f) {
270
270
try_period <- function (x ) {
271
271
err <- is.na(x )
272
272
if (! err ) {
273
- if (is.numeric(x ) ) {
273
+ if (is.numeric(x )) {
274
274
err <- ! rlang :: is_integerish(x ) || x < 0
275
275
} else {
276
276
x <- lubridate :: as.period(x )
@@ -279,12 +279,10 @@ try_period <- function(x) {
279
279
}
280
280
if (err ) {
281
281
cli_abort(paste(
282
- ' The value supplied to `before` or `after` must be a non-negative integer' ,
283
- ' a {.cls lubridate::period} or a character scalar that can be coerced' ,
282
+ " The value supplied to `before` or `after` must be a non-negative integer" ,
283
+ " a {.cls lubridate::period} or a character scalar that can be coerced" ,
284
284
' as a {.cls lubridate::period}, e.g., `"1 week"`.'
285
- ),
286
- )
285
+ ), )
287
286
}
288
287
x
289
288
}
290
-
0 commit comments