dataChk: dataChk

View source: R/reptools.r

dataChkR Documentation

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
)

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

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.

Value

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

Author(s)

Frank Harrell

Examples

## Not run: 
dataChk(mydata)

## End(Not run)

qreport documentation built on May 29, 2024, 3:51 a.m.