Author new functions that stops and provides a custom message when a predicate evaluates to true.

brake_ff(predicate, stop_message, arguments)

Arguments

predicate

Evaluating function.

stop_message

Message to receive with the predicate evaluates to true.

arguments

(option) character vector of arguments for the new function. If missing, the new function will not have any arguments. Arguments in the predicate should also be considered. For example, if the predicate is "is.logical(x)", the arguments value should be "x".

Value

Assigned function

See also