@@ -318,7 +318,7 @@ epi_slide <- function(
318318 unit_step <- unit_time_delta(time_type , format = " fast" )
319319 simple_hop <- time_slide_to_simple_hop(.slide_comp = .slide_comp , ... , .before_n_steps = before_n_steps , .after_n_steps = after_n_steps )
320320 result <- .x %> %
321- group_modify( function (grp_data , grp_key ) {
321+ group_map( .keep = TRUE , function (grp_data , grp_key ) {
322322 out_time_values <- ref_time_values_to_out_time_values(grp_data , .ref_time_values )
323323 res <- grp_data
324324 slide_values <- slide_window(grp_data , grp_key , simple_hop , before_n_steps , after_n_steps , unit_step , time_type , out_time_values )
@@ -331,6 +331,7 @@ epi_slide <- function(
331331 res <- vec_slice(res , vec_match(out_time_values , res $ time_value ))
332332 }
333333
334+ # TODO refactor this out and use it in epix_slide as well if possible
334335 if (is.null(.new_col_name )) {
335336 if (inherits(slide_values , " data.frame" )) {
336337 # Sometimes slide_values can parrot back columns already in `res`; allow
@@ -384,7 +385,10 @@ epi_slide <- function(
384385 res [[.new_col_name ]] <- slide_values
385386 }
386387 res
387- })
388+ }) %> %
389+ list_rbind() %> %
390+ arrange_col_canonical() %> % # XXX is this desired?
391+ group_by(!!! .x_orig_groups )
388392
389393 # If every group in epi_slide_one_group takes the
390394 # length(available_ref_time_values) == 0 branch then we end up here.
0 commit comments