Skip to content

group_by() sorts NA first #4227

@romainfrancois

Description

@romainfrancois
library(dplyr, warn.conflicts = FALSE)

tbl <- tibble(
  x = c("apple", NA, "banana"), 
  y = 1:3
)
tbl %>% 
  group_by(x) %>% 
  group_data()
#> # A tibble: 3 x 2
#>   x      .rows    
#>   <chr>  <list>   
#> 1 <NA>   <int [1]>
#> 2 apple  <int [1]>
#> 3 banana <int [1]>

simplified from #4220

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions