Learn R Programming

chk (version 0.4.0)

abort_chk: Abort Check

Description

A wrapper on err() that sets the subclass to be 'chk_error'.

Usage

abort_chk(..., n = NULL, tidy = TRUE)

Arguments

...

Multiple objects that are converted to a string using paste0(..., collapse = '').

n

The value of n for converting sprintf-like types.

tidy

A flag specifying whether capitalize the first character and add a missing period.

Value

Throws an error of class 'chk_error'.

Details

It is exported to allow users to easily construct their own chk_ functions.

See Also

err()

Examples

Run this code
# NOT RUN {
try(abort_chk("x must be NULL"))
try(abort_chk("`x` must be NULL"))
try(abort_chk("there %r %n problem value%s", n = 1))
try(abort_chk("there %r %n problem value%s", n = 1.5))
# }

Run the code above in your browser using DataLab