col_check: Check a single column for data fidelity.

Description Usage Arguments Value Examples

Description

Check a single column for data fidelity.

Usage

1
col_check(colname, data, fun, output = FALSE, stage = NULL, ...)

Arguments

colname

character string specifying the name of the column within your dataframe.

data

the dataframe containing the data.

fun

the check function you'd like to apply to the data.

output

logical. If FALSE, the function returns a dataframe containing only records that failed the specified check. If TRUE, invisibly prints an excel output file containing only the records that failed the specified check.

stage

An optional character string that can be used to specify the stage of the checking process in which the check is occurring. Only useful if output = TRUE. If a value is specified, a that value is prefixed to the output file; if no value is given, no stage prefix is attached.

...

arguments to be passed through to the function specified in fun

Value

col_check(output = FALSE) returns a dataframe containing only records that failed the specified check.

col_check(output = TRUE) invisibly prints an excel output file containing only records that failed the specified check.

Examples

1
2
3
4
5
col_check(colname = "ID_var", data = dataset, fun = numeric_check,
output = TRUE, stage = "1-Reasonableness")

col_check(colname = "FName", data = dataset, fun = character_check,
output = FALSE)

inspectr documentation built on May 2, 2019, 5:15 a.m.