chaining_functions

0th

Percentile

Chaining functions

These functions are for starting and ending a sequence of assertr assertions and overriding the default behavior of assertr halting execution on the first error.

Usage
chain_start(data)

chain_end(data, success_fun = success_continue, error_fun = error_report)

Arguments
data

A data frame

success_fun

Function to call if assertion passes. Defaults to returning data.

error_fun

Function to call if assertion fails. Defaults to printing a summary of all errors.

Details

For more information, read the relevant section in this package's vignette using, vignette("assertr")

For examples of possible choices for the success_fun and error_fun parameters, run help("success_and_error_functions")

Aliases
  • chaining_functions
  • chain_start
  • chain_end
Examples
# NOT RUN {
library(magrittr)

mtcars %>%
  chain_start() %>%
  verify(nrow(mtcars) > 10) %>%
  verify(mpg > 0) %>%
  insist(within_n_sds(4), mpg) %>%
  assert(in_set(0,1), am, vs) %>%
  chain_end()
# }
Documentation reproduced from package assertr, version 2.7, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.