data-cleaning / errorlocate

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

Bug: value > 1e7 in combination with NA value gives error #36

Closed edwindj closed 2 years ago

edwindj commented 2 years ago

Thanks to Ramon Reinders for reporting the following bug

library(errorlocate)
data <- iris[1,]
data$Petal.Width <- NA_real_
data$Petal.Length <- 1e7 + 1

rules <- validator(Petal.Width > 0, Petal.Length > 0)
try(locate_errors(data, rules))
Error in `[.data.frame`(data, nv) : undefined columns selected