Saves writing subset() over $findings by hand, and - because it returns
a result rather than a plain table - what comes back still prints as a
readable report.
Arguments
- result
A result from
check_dataset()orcheck_study().- triage
Keep only these triage levels. One or more of:
"wrong value"- the data contains something that breaks the rule, like a month of 13. Nothing about your study explains it away. Start here."missing required"- something the standard marks Required is absent."missing optional"- something Expected is absent, or a value is blank. Often legitimate: a screen-failure subject with no reference dates, a variable your raw data does not carry yet.
These are coreval's own triage, not a CDISC severity: the rules carry no severity field, and this does not map onto anyone's scale.
- dataset
Keep only these datasets, e.g.
"AE".- rule
Keep only these rule ids, e.g.
"CORE-000547".- variable
Keep only findings naming these variables, including a finding that lists the variable as missing (a Required variable the dataset lacks).
Value
A coreval_result holding the matching findings. $skipped is
left alone: what could not be checked does not become less true because
you narrowed what you are looking at.
Examples
ae <- data.frame(
STUDYID = "S1", DOMAIN = "AE", USUBJID = c("01", "01"),
AESEQ = c(1, 2), AETERM = c("Headache", "Rash"),
AESTDTC = c("2024-01-10", "2024-02-30")
)
result <- check_dataset(ae)
# Just the things that are definitely wrong:
filter_findings(result, triage = "wrong value")
#>
#> ── coreval — AE ────────────────────────────────────────────────────────────────
#>
#> (filtered - this is a subset of the full result)
#>
#> 2 problems across 1 record (159 checks ran)
#>
#> wrong value 2 the data breaks the rule - start here
#>
#> [wrong value]
#> Study Day of Start of Observation (--STDY) variable is missing when Start
#> Date/Time of Observation (--STDTC) is present.
#> the dataset · AESTDTC
#> AESTDTC = "2024-01-10"
#> CORE-000328 · also FB3202
#>
#> [wrong value]
#> Variable value is not in correct ISO 8601 date or datetime format
#> 1 record · AESTDTC
#> row 2 AESTDTC = "2024-02-30"
#> CORE-000547 · also SEND66, SEND67, SEND68, ...
#>
#> ────────────────────────────────────────────────────────────────────────────────
#> 48 checks could not run.
#> 24 need other datasets (DM, POOLDEF, SUPPAE, SV, TA, TO, ...)
#> → run check_study() on the whole folder to cover these
#> 14 ask what the whole study contains
#> 6 need a define.xml
#> 4 for other reasons, see result$skipped
#>
#> No standard declared, so rules from every standard ran.
#> Narrow with standard = "SDTMIG" (or "SENDIG", "TIG", ...)
#>
#> Fix what you can, then run this again.
#> To track the rest: write_findings(result, "issues.xlsx")
