File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -366,11 +366,22 @@ collector <- function(x, coll_col = ".predictions") {
366
366
} else {
367
367
keep_cols <- coll_col
368
368
}
369
- x <- dplyr :: select(x , dplyr :: starts_with(" id" ), !!! keep_cols )
370
- x <- tidyr :: unnest(x , cols = c(dplyr :: all_of(coll_col )))
369
+
370
+ id_cols <- colnames(x )[grepl(" id" , colnames(x ))]
371
+ keep_cols <- c(coll_col , id_cols )
372
+ x <- x [keep_cols ]
373
+ coll_col <- x [[coll_col ]]
374
+
375
+ res <-
376
+ vctrs :: vec_cbind(
377
+ vctrs :: list_unchop(coll_col ),
378
+ vctrs :: vec_rep_each(x [, id_cols ], times = vctrs :: list_sizes(coll_col ))
379
+ )
380
+
371
381
arrange_cols <- c(" .iter" , " .config" )
372
- arrange_cols <- arrange_cols [(arrange_cols %in% names(x ))]
373
- arrange(x , !!! rlang :: syms(arrange_cols ))
382
+ arrange_cols <- arrange_cols [rlang :: has_name(res , arrange_cols )]
383
+
384
+ res <- vctrs :: vec_slice(res , vctrs :: vec_order(res [arrange_cols ]))
374
385
}
375
386
376
387
# ' @export
You can’t perform that action at this time.
0 commit comments