Learn R Programming

errorlocate (version 1.1.1)

errors_removed: Get location of removed errors from a 'cleaned' data set

Description

errors_removed retrieves the errors detected by replace_errors()

Usage

errors_removed(x, ...)

Value

errorlocation-class() object

Arguments

x

data.frame that was checked for errors

...

not used

See Also

Other error finding: errorlocation-class, expand_weights(), locate_errors(), replace_errors()

Examples

Run this code
rules <- validator( profit + cost == turnover
              , cost - 0.6*turnover >= 0
              , cost>= 0
              , turnover >= 0
)
data <- data.frame(profit=755, cost=125, turnover=200)

data_no_error <- replace_errors(data,rules)

# faulty data was replaced with NA
data_no_error

errors_removed(data_no_error)

# a bit more control, you can supply the result of locate_errors
# to replace_errors, which is a good thing, otherwise replace_errors will call
# locate_errors internally.
error_locations <- locate_errors(data, rules)
replace_errors(data, error_locations)

Run the code above in your browser using DataLab