data-cleaning / errorlocate

Find and replace erroneous fields in data using validation rules
http://data-cleaning.github.io/errorlocate/
21 stars 3 forks source link

Numeric colums with values >= 1e7 make solution `FALSE` #30

Closed edwindj closed 3 years ago

edwindj commented 3 years ago

rules <- validator( profit == turnover - cost
                  , cost >= 0.6 * turnover
                  , turnover >= 0
                  )

data <- data.frame(profit = 1e10, cost = 200, turnover = 300)
el <- locate_errors(data, rules)
el$errors
##     profit cost turnover
##[1,]   TRUE TRUE     TRUE

el$status
# 2 

This large a value makes the MIP problem unsolveable.
Thanks to Garðar Páll Gíslason for reporting!
edwindj commented 3 years ago

This issue is fixed in github. Issue will be closed when on CRAN.

edwindj commented 3 years ago

New behavior is:

rules <- validator( profit == turnover - cost
                  , cost >= 0.6 * turnover
                  , turnover >= 0
                  )

data <- data.frame(profit = 1e10, cost = 200, turnover = 300)
el <- locate_errors(data, rules)

el$errors
##     profit cost turnover
##[1,]   TRUE FALSE     FALSE

el$status
# 0
edwindj commented 3 years ago

Is fixed

edwindj commented 3 years ago

(it generates a warning though)