Learn R Programming

validate (version 0.1.5)

aggregate,validation-method: Aggregate validation results

Description

Aggregate results of a validation.

Usage

"aggregate"(x, by = c("rule", "record"), drop = TRUE, ...)

Arguments

x
An object of class validation
by
Report on violations per rule (default) or per record?
drop
drop list attribute if the result is list of length 1
...
Arguments to be passed to or from other methods.

Value

By default, a data.frame with the following columns.
npass
Number of items passed
nfail
Number of items failing
nNA
Number of items resulting in NA
rel.pass
Relative number of items passed
rel.fail
Relative number of items failing
If by='rule' the relative numbers are computed with respect to the number of records for which the rule was evaluated. If by='record' the relative numbers are computed with respect to the number of rules the record was tested agains.When by='record' and not all validation results have the same dimension structure, a list of data.frames is returned.

See Also

Examples

Run this code

data(retailers)
retailers$id <- paste0("ret",1:nrow(retailers))
v <- validator(
    staff.costs/staff < 25
  , turnover + other.rev==total.rev)

cf <- confront(retailers,v,key="id")
a <- aggregate(cf,by='record')
head(a)

# or, get a sorted result:
s <- sort(cf, by='record')
head(s)


Run the code above in your browser using DataLab