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

if (<var> == FALSE) ... handled incorrectly (<= 0.3 #23

Closed
edwindj opened this issue Feb 18, 2020 · 1 comment
Closed

if (<var> == FALSE) ... handled incorrectly (<= 0.3 #23

edwindj opened this issue Feb 18, 2020 · 1 comment

Comments

@edwindj
Copy link
Member

edwindj commented Feb 18, 2020

This is an edge case, which happens only when a logical variable is used with FALSE.

library(errorlocate)
rules <- validator(if (A == FALSE) x > 0)
data <- data.frame(A = FALSE, x = -1)

This should return an error (but it doesn't):

locate_errors(data, rules)$errors
##          A     x
## [1,] FALSE FALSE
@edwindj
Copy link
Member Author

edwindj commented Feb 18, 2020

Fixed in >= 0.3

library(errorlocate)
rules <- validator(if (A == FALSE) x > 0)
data <- data.frame(A = FALSE, x = -1)

This should return an error:

locate_errors(data, rules)$errors
##          A    x
## [1,] FALSE TRUE

@edwindj edwindj closed this as completed Feb 18, 2020
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

1 participant