nathaneastwood / poorman

A poor man's dependency free grammar of data manipulation
https://nathaneastwood.github.io/poorman/
Other
340 stars 15 forks source link

Fix: distinct() resets row names if they are numeric #106

Closed etiennebacher closed 2 years ago

etiennebacher commented 2 years ago

Close #104. New behavior:

suppressPackageStartupMessages(library(poorman))

df <- data.frame(
  a = c(1, 1, 2, 2),
  b = c(3, 4, 5, 6)
)

df %>% 
  dplyr::distinct(a, .keep_all = TRUE)
#>   a b
#> 1 1 3
#> 2 2 5

df %>% 
  poorman::distinct(a, .keep_all = TRUE)
#>   a b
#> 1 1 3
#> 2 2 5

Created on 2022-08-02 by the reprex package (v2.0.1)