Skip to contents

Use exit_file to exit a file with a custom message, or use exit_if to exit if one or more conditions are met. exit_if will create a message akin to messages created by stopifnot.

Usage

exit_file(msg = "")

exit_if_not(...)

Arguments

msg

[character] An optional message to print after exiting.

...

A comma-separated list of conditions.

Value

The exit message

Examples

exit_file("I'm too tired to test")
#> [1] "I'm too tired to test"
exit_if_not(packageVersion("tinytest")  >= "1.0.0")
#> NULL
if (FALSE) { # \dontrun{
exit_if_not(requireNamespace("foo",quietly=TRUE))
} # }