### Install errorlocate Beta Version with drat Source: https://github.com/data-cleaning/errorlocate/blob/master/README.md Install beta versions of the errorlocate package using the drat repository. ```r drat::addRepo("data-cleaning") install.packages("errorlocate") ``` -------------------------------- ### Install errorlocate from CRAN Source: https://github.com/data-cleaning/errorlocate/blob/master/README.md Install the stable version of the errorlocate package from CRAN. ```r install.packages("errorlocate") ``` -------------------------------- ### Install Latest Development Version from GitHub Source: https://github.com/data-cleaning/errorlocate/blob/master/README.md Install the most recent development version of the errorlocate package directly from GitHub using devtools. ```r devtools::install_github("data-cleaning/errorlocate") ``` -------------------------------- ### Basic Usage of errorlocate Source: https://github.com/data-cleaning/errorlocate/blob/master/README.md Demonstrates how to use the errorlocate package to define validation rules, identify errors in data, and replace erroneous values with NA. ```r library(errorlocate) #> Loading required package: validate rules <- validator( profit == turnover - cost, cost >= 0.6 * turnover, turnover >= 0, cost >= 0 # is implied ) data <- data.frame(profit=750, cost=125, turnover=200) data_no_error <- replace_errors(data, rules) # faulty data was replaced with NA print(data_no_error) #> profit cost turnover #> 1 NA 125 200 er <- errors_removed(data_no_error) print(er) #> call: locate_errors(data, x, ref, ..., cl = cl, Ncpus = Ncpus) #> located 1 error(s). #> located 0 missing value(s). #> Use 'summary', 'values', '$errors' or '$weight', to explore and retrieve the errors. summary(er) #> Variable: #> name errors missing #> 1 profit 1 0 #> 2 cost 0 0 #> 3 turnover 0 0 #> Errors per record: #> errors records #> 1 1 1 er$errors #> profit cost turnover #> [1,] TRUE FALSE FALSE ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.