vc_regex: Validates and Reports If Formatted Like Regex Provided

View source: R/vc_regex.R

vc_regexR Documentation

Validates and Reports If Formatted Like Regex Provided

Description

Validates and Reports If Formatted Like Regex Provided

Usage

vc_regex(data, x, regex, ...)

Arguments

data

A data frame.

x

Column name from data (character string).

regex

the regular expression to be tested against.

...

ignored.

Examples

dat <- data.frame(
    vals = c('Greg', 'John', 'Tyrone', 'Susan', 'Kyra', 'Nells12', NA, ""),
    stringsAsFactors = FALSE
 )
vc_regex(dat, 'vals', '^[A-Z][^0-9]+$')
vc_regex(dat, 'vals', '^[A-Z].+$')

steventsimpson/valiData documentation built on Jan. 27, 2023, 2:11 p.m.