-
Notifications
You must be signed in to change notification settings - Fork 34
/
chaining_functions.Rd
46 lines (40 loc) · 1.27 KB
/
chaining_functions.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/errors.R
\name{chaining_functions}
\alias{chaining_functions}
\alias{chain_start}
\alias{chain_end}
\title{Chaining functions}
\usage{
chain_start(data, store_success = FALSE)
chain_end(data, success_fun = success_continue, error_fun = error_report)
}
\arguments{
\item{data}{A data frame}
\item{store_success}{If TRUE each successful assertion is stored in chain.}
\item{success_fun}{Function to call if assertion passes. Defaults to
returning \code{data}.}
\item{error_fun}{Function to call if assertion fails. Defaults to printing
a summary of all errors.}
}
\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.
}
\details{
For more information, read the relevant section in this package's
vignette using, \code{vignette("assertr")}
For examples of possible choices for the \code{success_fun} and
\code{error_fun} parameters, run \code{help("success_and_error_functions")}
}
\examples{
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()
}