nathaneastwood / poorman

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

`distinct()` doesn't reset row names #104

Closed etiennebacher closed 2 years ago

etiennebacher commented 2 years ago

Describe the bug Similar behavior as in #86.

To Reproduce

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
#> 3 2 5

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

Expected behavior Row names in the above examples should be 1 and 2

System Information: Please detail the following information

Additional context /