Learn R Programming

checkmate (version 1.0)

checkNull: Check if an argument is NULL

Description

Check if an argument is NULL

Usage

checkNull(x)

assertNull(x, .var.name)

testNull(x)

Arguments

x
[ANY] Object to check.
.var.name
[character(1)] Name for x. Defaults to a heuristic to determine the name using deparse and substitute.

Value

  • Depending on the function prefix: If the check is successful, all functions return TRUE. If the check is not successful, assertNull throws an error message, testNull returns FALSE and checkNull returns a string with the error message.

Examples

Run this code
testNull(NULL)
 testNull(1)

Run the code above in your browser using DataLab