Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

Details

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

Value

Throws an error of class 'chk_error'.

See Also

Examples

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

chk

Check User-Supplied Function Arguments

v0.5.1
MIT + file LICENSE
Authors
Joe Thorley [aut, cre] (<https://orcid.org/0000-0002-7683-4592>), Kirill Müller [aut] (<https://orcid.org/0000-0002-1416-3412>), Ayla Pearson [ctb] (<https://orcid.org/0000-0001-7388-1222>), Poisson Consulting [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.