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

Add status info from the lp solver to output #26

Closed edwindj closed 3 years ago

edwindj commented 3 years ago

Thx to Sander Scholtus

edwindj commented 3 years ago

In development version this is activated:

library(errorlocate)

## Loading required package: validate

# super simple example
rules <- validator( x > 1)
d <- data.frame( x = c(0,1,2,-1))
d

##    x
## 1  0
## 2  1
## 3  2
## 4 -1

el <- locate_errors(d, rules)

el$duration

## [1] 0.06847143 0.07108474 0.00000000 0.05565333

el$status

## [1] 0 0 0 0

# impossible system (contradicting rules)
rules <- validator( x > 1, x < -1)
d <- data.frame( x = 0 )
el <- locate_errors(d, rules)
el$status

## [1] 2
edwindj commented 3 years ago

Is added to errorlocation: $status and $duration