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

find_duplicate_cols() does not handle duplicated columns containing NAs #1

Open
jcken95 opened this issue May 3, 2024 · 2 comments

Comments

@jcken95
Copy link

jcken95 commented May 3, 2024

find_duplicate_cols() cannot handle duplicate columns when NA values are present.

reprex:

df <- data.frame(
    x = c(1, NA),
    y = c(1, NA)
  )
fixr::find_duplicate_cols(df)
#> Error in if (all(df[, i] == df[, j])) {: missing value where TRUE/FALSE needed

Created on 2024-05-03 by the reprex package (v2.0.1)

@ambuvjyn
Copy link
Owner

ambuvjyn commented May 4, 2024

Hey @jcken95 Thanks for sharing this issue, I will resolve this.

@jcken95
Copy link
Author

jcken95 commented May 7, 2024

I imagine identical(df[, i], df[, j]) is more appropriate than all(df[, i] == df[, j]) in this instance

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