slice_min and slice_max drop rows where the value in the order_by column is NA, returning fewer than the requested number of rows if n is large enough.
It's unclear to me whether this is a bug or just intended behavior that requires documenting.
library(tibble)
library(dplyr)
x <- tibble(a = 1:3, b = c(10, NA, 12))
slice_min(x, b, n = 3)
slice_minandslice_maxdrop rows where the value in theorder_bycolumn isNA, returning fewer than the requested number of rows ifnis large enough.It's unclear to me whether this is a bug or just intended behavior that requires documenting.