Description Usage Arguments Value Examples
One check test results in an empty string, an NA, or error message. Multiple test checks can be merged into a vector with each element named for a test and giving its outcome. This can then be summarized into a single check result by merging error strings if any, reporting an empty string if everything passed, and handling NA's as either errors or ignoring them.
1 | checkSummary(result, naOk = NULL, skip = NULL)
|
result |
A vector of check results, with element values being an empty
string (success), a failure string, or |
naOk |
A vector of the names of elements for which |
skip |
A vector of the names of elements to be left out of the summary, regardless of their value. By default all elements are considered and used. |
As other check functions, this returns a single character string which is empty if the check succeeds and contains a failure message if the the check fails. However, here success means all tests not skipped succeed. Missing values are by default considered failures. A failure message is reported if any element failed.
The failure message is formated like "<testName> = <error message>; ..."
where each element with a failing message, from first to last, are reported
and joined by '; '. If an element has a missing value, it will first be
converted to the failure string "NA not ok."
before summarizing,
unless its test name is provided in a string vector as naOk
(or as
skip
, except then its value will be ignored even if it failed.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | fauxChecks <- c('', '', '')
names(fauxChecks) <- c('checkA', 'checkB', 'checkC')
checkSummary(fauxChecks)
#=> [1] ""
fauxChecks['checkC'] <- NA_character_
checkSummary(fauxChecks)
#=> [1] "checkC = NA not ok."
checkSummary(fauxChecks, naOk= c('checkC'))
#=> [1] ""
fauxChecks['checkB'] <- 'I am broken.'
checkSummary(fauxChecks)
#=> [1] "checkB = I am broken.; checkC = NA not ok."
checkSummary(fauxChecks, naOk= c('checkB', 'checkC'))
#=> [1] "checkB = I am broken."
checkSummary(fauxChecks, skip= c('checkB', 'checkC'))
#=> [1] ""
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.