Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: is_dupes() #485

Closed
brunomioto opened this issue Jun 29, 2022 · 1 comment
Closed

Feature request: is_dupes() #485

brunomioto opened this issue Jun 29, 2022 · 1 comment

Comments

@brunomioto
Copy link

Feature requests

The get_dupes() function returns a data.frame with the duplicated names.
The new is_dupes() would return a TRUE/FALSE when there's another name/value duplicated on the dataset.

data.frame(
  x = c("Brazil", "US", "Brazil", "China", "UK"),
  is_dupes = c(TRUE, FALSE, TRUE, FALSE, FALSE)
)
#>        x is_dupes
#> 1 Brazil     TRUE
#> 2     US    FALSE
#> 3 Brazil     TRUE
#> 4  China    FALSE
#> 5     UK    FALSE

Created on 2022-06-29 by the reprex package (v2.0.1)

@sfirke
Copy link
Owner

sfirke commented Jan 30, 2023

I think these two lines do it:

mtcars %>%
  dplyr::add_count(mpg, name = "is_dupe") %>%
  dplyr::mutate(as.logical(is_dupe-1))

A janitor function would likely just be wrapping that. Given that it's just two lines in dplyr, and the limited capacity for developing janitor, I'm going to close this as unplanned. And I apologize for taking so long to acknowledge this suggestion! 😔

@sfirke sfirke closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants