validate
validate copied to clipboard
Negated inequality does not take rounding into account
library(validate)
rules <- validator(!(x > 0))
rules2 <- validator(x <= 0)
dat <- data.frame(x = 1.001)
summary(confront(dat, rules, lin.ineq.eps=0.01))
## name items passes fails nNA error warning expression
## 1 V1 1 0 1 0 FALSE FALSE !(x > 0)
summary(confront(dat, rules2, lin.ineq.eps=0.01))
## name items passes fails nNA error warning expression
## 1 V1 1 0 1 0 FALSE FALSE (x - 0) <= 0.01
See also #136 : would be fixed when sub expressions are taken into account
Thanks to Sigrid van Hoek for noticing!