Skip to content

NA handling in slice_min / slice_max #6177

Description

@kmillar

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementrows ↕️Operations on rows: filter(), slice(), arrange()

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions