Function to assert if exposure resulted in detecting some rule breakers.

assert_any_breaker(.tbl, .type = "error", .silent = FALSE, ...)

Arguments

.tbl

Result of exposure, i.e. data frame with exposure attribute.

.type

The type of assertion. Can be only one of "error", "warning" or "message".

.silent

If TRUE no printing of rule breaker information is done.

...

Arguments for printing rule breaker information.

Details

In case breaker presence this function does the following:

  • In case .silent is FALSE print rows from exposure report corresponding to rule breakers.

  • Make assertion of the chosen .type about breaker presence in exposure.

  • Return .tbl (for using inside a pipe).

If there are no breakers only .tbl is returned.

See also

any_breaker for checking of breaker presence in exposure result.

act_after_exposure for making general actions based in exposure result.

Examples

if (FALSE) {
mtcars %>%
  expose(data_packs(. %>% dplyr::summarise(nrow_low = nrow(.) > 50))) %>%
  assert_any_breaker()
}