vc_: Generic Column Validation

View source: R/vc_.R

vc_R Documentation

Generic Column Validation

Description

Generic column validation

Usage

vc_(data, x, expr, augment_comment = NULL, ...)

Arguments

data

A data frame.

x

Column name from data (character string).

expr

An string that can be evaluated elementwise as an expression to test on x column (include column x as seen in Examples below).

augment_comment

details to be added to message, if any

...

ignored.

Value

Returns a vc classed list object.

Examples

vc_(mtcars, 'mpg', 'abs(scale(mpg)) < 2')
vc_(mtcars, 'mpg', 'abs(scale(mpg)) < 2',
    augment_comment = "...\n    because they may be (outliers > 2 sd)")
vc_(CO2, 'Type', '!grepl("^M", Type)',
    augment_comment = " because they don't begin with `M`")
vc_(mtcars, 'drat', 'drat >= wt',
    augment_comment = " because `drat` is less than `wt`")
str(vc_(mtcars, 'mpg', 'abs(scale(mpg)) < 2'))

data-steve/valiData documentation built on Feb. 3, 2023, 12:21 a.m.