Introduction

In this vignette we show how to implement a set of common types of validation rules with the validate package.

Validation rules

In the validate package, a validation rule is any R-expression that when evaluated, necessarily results in a logical or NA. The idea is that a validation rule expresses a condition on a data set that you wish to check, before using the set for producing statistical statements. Examples may include:

  • All ages must be positive
  • The covariance between height and weight must exceed 0.9
  • If a company employs staff, the amount of salary payed must be positive.

There are many examples thinkable.

For a more formal definition of data validation and some of the ideas that underly the validate package, also see this paper or the presentation.

Type checks

Any