Learn R Programming

qreport (version 1.0-1)

dataChk: dataChk

Description

Run a Series of Data Checks and Report

Usage

dataChk(
  d,
  checks,
  id = character(0),
  html = FALSE,
  omit0 = FALSE,
  byid = FALSE,
  nrows = 500
)

Value

an invisible data frame containing variables check (the expression checked) and n (the number of records satisfying the expression)

Arguments

d

a data table

checks

a vector of expressions that if satisfied causes records to be listed

id

option vector of variable names to serve as IDs

html

set to TRUE to create HTML output and put each check in a separate tab, also creating summary tabs

omit0

set to TRUE to ignore checks finding no observations

byid

if id is given set byid=TRUE to also list a data frame with all flagged conditions, sorted by id

nrows

maximum number of rows to allow to be printed

Author

Frank Harrell

Details

Function to run various data checks on a data table.

Checks are run separately for each part of the expression vector checks. For each single expression, the variables listed in the output are all the variables mentioned in the expression plus optional variables whose names are in the character vector id. %between% c(a,b) in expressions is printed as [a,b]. The output format is plain text unless html=TRUE which also puts each table in a separate Quarto tab. See here for examples.

Examples

Run this code
if (FALSE) {
dataChk(mydata)
}

Run the code above in your browser using DataLab