chaining_functions: Chaining functions

Description Usage Arguments Details Examples

Description

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

1
2
3

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")

Examples

1
2
3
4
5
6
7
8
9
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()

lorenzwalthert/assertr documentation built on May 20, 2019, 4:06 p.m.