satisfying {validate}R Documentation

Select records (not) satisfying rules

Description

Apply validation rules or validation results to a data set and select only those that satisfy all or violate at least one rule.

Usage

satisfying(x, y, include_missing = FALSE, ...)

violating(x, y, include_missing = FALSE, ...)

lacking(x, y, ...)

Arguments

x

A data.frame

y

a validator object or a validation object.

include_missing

Toggle: also select records that have NA output for a rule?

...

options passed to confront

Value

For satisfying, the records in x satisfying all rules or validation outcomes in y. For violating the records in x violating at least one of the rules or validation outcomes in y

Note

An error is thrown if the rules or validation results in y can not be interpreted record-by record (e.g. when one of the rules is of the form mean(foo)>0).

Examples

rules <- validator(height >= 60,weight < 159)
satisfying(women, rules)
violating(women, rules)

out <- confront(women, rules)
summary(out)
satisfying(women, out)
violating(women, out)


[Package validate version 1.0.1 Index]