Describe the bug
Running fslice will yield an 'R encountered a fatal error' crash when grouping by a variable and a group has only missing values in the order.by variable.
Steps/Code to Reproduce
tibble::tibble(group_var = c("a", "a", "b", "b", "c", "c"),
order_var = c(1, 2, 3, NA, NA, NA)) |>
collapse::fslice(group_var,
order.by = order_var,
how = "min", n = 1)
Expected behavior
In the repro example, group c should return only the first row in the group (or both rows if with.ties = TRUE)
Additional context
Run in R version 4.6.0 (2026-04-24) -- "Because it was There".
Describe the bug
Running
fslicewill yield an 'R encountered a fatal error' crash when grouping by a variable and a group has only missing values in theorder.byvariable.Steps/Code to Reproduce
Expected behavior
In the repro example, group
cshould return only the first row in the group (or both rows ifwith.ties = TRUE)Additional context
Run in R version 4.6.0 (2026-04-24) -- "Because it was There".