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

out domain error for categorical variable not working for single variable #25

Closed
nickforr opened this issue Sep 30, 2020 · 4 comments
Closed

Comments

@nickforr
Copy link

nickforr commented Sep 30, 2020

Similar to #14 but when the comparison is a single element the wrong answer seems to be returned.

library(errorlocate)
rules <- validator( x %in% c("A"))
data <- data.frame(x = "C")
locate_errors(data, rules)$errors

This returns FALSE but should return TRUE. For completeness, the example used in #14 is:

rules <- validator( x %in% c("A", "B"))
data <- data.frame(x = "C")
locate_errors(data, rules)$errors

which returns TRUE.

Using errorlocate version 0.4 on R 3.6.3 on Windows.

Incidentally, the following seems to work:

rules <- validator( x %in% c("A", "A"))
data <- data.frame(x = "C")
locate_errors(data, rules)$errors
@edwindj
Copy link
Member

edwindj commented Sep 30, 2020

Thanks for reporting! I will have a look at it asap.

edwindj added a commit that referenced this issue Sep 30, 2020
@edwindj
Copy link
Member

edwindj commented Sep 30, 2020

In my tests this is solving the issue, could you please check if it is working for you?

remotes::install_github("data-cleaning/errorlocate")

If it is working I will update CRAN in a week or so. (CRAN does not like high frequency updates :-) )

@edwindj
Copy link
Member

edwindj commented Sep 30, 2020

Closing issue, please reopen if necessary...

@edwindj edwindj closed this as completed Sep 30, 2020
@nickforr
Copy link
Author

Working perfectly, thanks for speedy fix. And thanks for this and validate, really easy to use and very helpful.

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