validateLimits: Validate the limits imposed on a column

Description Usage Arguments Value Validation rules

Description

Checks the validity of inequality restrictions imposed on a column. It uses a direct connection to the dzVis database or a data.frame as the data source.

Usage

1
validateLimits(data, columnName, min, max)

Arguments

data

A data.frame with the actual data source or a character containing the name of the table in the dzVis database. If it is a data.frame, a connection to the dzVis database WILL NOT be estabilished. If it is a character, a connection WILL be estabilished.

columnName

A character. The name of the column to be checked.

min

A numeric value, a character or a Date in the format 'yyyy-mm-dd'. Lower bound for the column value. Should be set to NULL when not applicable.

max

A numeric value, a character or a Date in the format 'yyyy-mm-dd'. Upper bound for the column value. Should be set to NULL when not applicable.

Value

A character. The constant .VALID if the limits are valid and an error message, otherwise.

Validation rules

  1. min and max must be of the same type: both numeric or both character.

  2. min must be less than max

  3. If min and max type is numeric, the column values must also be numeric in R and int or double in the database.

  4. If min and max type is character, the column values must be character in R and varchar in the database.

  5. If min and max type is Date, the column values must be Date in R and date or datetime in the database.


talithafs/dzVis-Package documentation built on May 31, 2019, 2:54 a.m.