@@ -107,25 +107,17 @@ 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
- f_dots_baked( grp_data [, in_colnames ], seq_len(nrow(grp_data )), adaptive = TRUE )
116
+ .f( x = grp_data [, in_colnames ], n = seq_len(nrow(grp_data )), adaptive = TRUE , ... )
125
117
}
126
118
} else {
127
119
function (grp_data , grp_key , ref_inds ) {
128
- out_cols <- .f(grp_data [, in_colnames ], .before_n_steps + .after_n_steps + 1L , ... )
120
+ out_cols <- .f(x = grp_data [, in_colnames ], n = .before_n_steps + .after_n_steps + 1L , ... )
129
121
if (.after_n_steps != 0L ) {
130
122
# Shift an appropriate amount of NA padding from the start to the end.
131
123
# (This padding will later be cut off when we filter down to the
@@ -142,7 +134,7 @@ upstream_slide_to_simple_hop <- function(.f, ..., .in_colnames, .out_colnames, .
142
134
function (grp_data , grp_key , ref_inds ) {
143
135
names(in_colnames ) <- in_colnames
144
136
lapply(in_colnames , function (in_colname ) {
145
- f_dots_baked( grp_data [[in_colname ]], before = .before_n_steps , after = .after_n_steps )
137
+ .f( x = grp_data [[in_colname ]], before = .before_n_steps , after = .after_n_steps , ... )
146
138
})
147
139
},
148
140
# TODO improve message
0 commit comments