A Selection of Examples

A validation with the basics.

A validation with a comprehensive set of rules.

Pulling out data extracts that highlight rows with validation failures.

Splitting your data into ‘pass’ and ‘fail’ subsets.


Numeric Comparisons
Perform comparisons of values in columns to fixed values.

Comparison Checks Across Columns
Perform comparisons of values in columns to values in other columns.

Apply Validation Rules to Multiple Columns
Create multiple validation steps by using a list of column names with columns=.

Checks for Missing Values
Perform validations that check whether missing/NA/Null values are present.

Expectations with a Text Pattern
With col_vals_regex(), check for conformance to a regular expression.

Set Membership
Perform validations that check whether values are part of a set (or not part of one).

Expect No Duplicate Rows
We can check for duplicate rows in the table with rows_distinct().

Checking for Duplicate Values
To check for duplicate values down a column, use rows_distinct() with a columns_subset= value.

Custom Expression for Checking Column Values
A column expression can be used to check column values. Just use col_vals_expr() for this.

Mutate the Table in a Validation Step
For far more specialized validations, modify the table with the pre= argument before checking it.

Verifying Row and Column Counts
Check the dimensions of the table with the *_count_match() validation methods.

Set Failure Threshold Levels
Set threshold levels to better gauge adverse data quality.

Column Selector Functions: Easily Pick Columns
Use column selector functions in the columns= argument to conveniently choose columns.

Check the Schema of a Table
The schema of a table can be flexibly defined with Schema and verified with col_schema_match().