Learn R Programming

sgapi (version 1.0.3)

assert_function: Escape Function in Case of Errors

Description

Evaluate condition and return error message if condition not satisfied.

Usage

assert_function(condition, msg)

Value

No return value, called for side effects.

Arguments

condition

a logical expresssion (e.g. is.null(test_variable))

msg

the error message returned if the condition is not met.

Examples

Run this code
assert_function(1==2,"Incorrect inequality")

Run the code above in your browser using DataLab