@@ -107,28 +107,20 @@ upstream_slide_to_simple_hop <- function(.f, ..., .in_colnames, .out_colnames, .
107
107
in_colnames <- .in_colnames
108
108
out_colnames <- .out_colnames
109
109
f_from_package <- f_info $ from_package
110
- f_dots_baked <-
111
- if (rlang :: dots_n(... ) == 0L ) {
112
- # Leaving `.f` unchanged slightly improves computation speed and trims
113
- # debug stack traces:
114
- .f
115
- } else {
116
- purrr :: partial(.f , ... = , ... ) # `... =` stands in for future args
117
- }
118
110
switch (f_from_package ,
119
111
data.table = if (.before_n_steps == Inf ) {
120
112
if (.after_n_steps != 0L ) {
121
113
stop(" .before_n_steps only supported with .after_n_steps = 0" )
122
114
}
123
115
function (grp_data , grp_key , ref_inds ) {
124
116
grp_data [, out_colnames ] <-
125
- f_dots_baked( grp_data [, in_colnames ], seq_len(nrow(grp_data )), adaptive = TRUE )
117
+ .f( x = grp_data [, in_colnames ], n = seq_len(nrow(grp_data )), adaptive = TRUE , ... )
126
118
grp_data [, out_colnames ] <- out_cols
127
119
grp_data
128
120
}
129
121
} else {
130
122
function (grp_data , grp_key , ref_inds ) {
131
- out_cols <- .f(grp_data [, in_colnames ], .before_n_steps + .after_n_steps + 1L , ... )
123
+ out_cols <- .f(x = grp_data [, in_colnames ], n = .before_n_steps + .after_n_steps + 1L , ... )
132
124
if (.after_n_steps != 0L ) {
133
125
# Shift an appropriate amount of NA padding from the start to the end.
134
126
# (This padding will later be cut off when we filter down to the
@@ -145,7 +137,7 @@ upstream_slide_to_simple_hop <- function(.f, ..., .in_colnames, .out_colnames, .
145
137
function (grp_data , grp_key , ref_inds ) {
146
138
names(in_colnames ) <- in_colnames
147
139
lapply(in_colnames , function (in_colname ) {
148
- f_dots_baked( grp_data [[in_colname ]], before = .before_n_steps , after = .after_n_steps )
140
+ .f( x = grp_data [[in_colname ]], before = .before_n_steps , after = .after_n_steps , ... )
149
141
})
150
142
},
151
143
# TODO improve message
0 commit comments