File tree 2 files changed +20
-4
lines changed
2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,22 @@ step_epi_lag <-
55
55
... ,
56
56
role = " predictor" ,
57
57
trained = FALSE ,
58
- lag = 1 ,
58
+ lag ,
59
59
prefix = " lag_" ,
60
60
default = NA ,
61
61
columns = NULL ,
62
62
skip = FALSE ,
63
63
id = rand_id(" epi_lag" )) {
64
+ if (missing(lag )) {
65
+ rlang :: abort(
66
+ c(" The `lag` argument must not be empty." ,
67
+ i = " Did you perhaps pass an integer in `...` accidentally?" ))
68
+ }
64
69
arg_is_nonneg_int(lag )
65
70
arg_is_chr_scalar(prefix , id )
71
+ if (! is.null(columns ))
72
+ rlang :: abort(c(" The `columns` argument must be `NULL." ,
73
+ i = " Use `tidyselect` methods to choose columns to lag." ))
66
74
add_step(recipe ,
67
75
step_epi_lag_new(
68
76
terms = dplyr :: enquos(... ),
@@ -88,14 +96,22 @@ step_epi_ahead <-
88
96
... ,
89
97
role = " outcome" ,
90
98
trained = FALSE ,
91
- ahead = 1 ,
99
+ ahead ,
92
100
prefix = " ahead_" ,
93
101
default = NA ,
94
102
columns = NULL ,
95
103
skip = FALSE ,
96
104
id = rand_id(" epi_ahead" )) {
105
+ if (missing(ahead )) {
106
+ rlang :: abort(
107
+ c(" The `ahead` argument must not be empty." ,
108
+ i = " Did you perhaps pass an integer in `...` accidentally?" ))
109
+ }
97
110
arg_is_nonneg_int(ahead )
98
111
arg_is_chr_scalar(prefix , id )
112
+ if (! is.null(columns ))
113
+ rlang :: abort(c(" The `columns` argument must be `NULL." ,
114
+ i = " Use `tidyselect` methods to choose columns to lead." ))
99
115
add_step(recipe ,
100
116
step_epi_ahead_new(
101
117
terms = dplyr :: enquos(... ),
You can’t perform that action at this time.
0 commit comments