Run a Series of Data Checks and Report
dataChk(
d,
checks,
id = character(0),
html = FALSE,
omit0 = FALSE,
byid = FALSE,
nrows = 500
)
an invisible data frame containing variables check
(the expression checked) and n
(the number of records satisfying the expression)
a data table
a vector of expressions that if satisfied causes records to be listed
option vector of variable names to serve as IDs
set to TRUE
to create HTML output and put each check in a separate tab, also creating summary tabs
set to TRUE
to ignore checks finding no observations
if id
is given set byid=TRUE
to also list a data frame with all flagged conditions, sorted by id
maximum number of rows to allow to be printed
Frank Harrell
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.
if (FALSE) {
dataChk(mydata)
}
Run the code above in your browser using DataLab