Learn R Programming

crew (version 0.8.0)

crew_assert: Crew assertion

Description

Assert that a condition is true.

Usage

crew_assert(value = NULL, ..., message = NULL, envir = parent.frame())

Value

NULL (invisibly). Throws an error if the condition is not true.

Arguments

value

An object or condition.

...

Conditions that use the "." symbol to refer to the object.

message

Optional message to print on error.

envir

Environment to evaluate the condition.

See Also

Other utility: crew_clean(), crew_deprecate(), crew_eval(), crew_random_name(), crew_retry(), crew_terminate_process(), crew_terminate_signal(), crew_worker()

Examples

Run this code
crew_assert(1 < 2)
crew_assert("object", !anyNA(.), nzchar(.))
tryCatch(
  crew_assert(2 < 1),
  crew_error = function(condition) message("false")
)

Run the code above in your browser using DataLab