checkScalarNA {checkmate}R Documentation

Check if an argument is a single missing value

Description

Check if an argument is a single missing value

Usage

checkScalarNA(x)

assertScalarNA(x, .var.name)

testScalarNA(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, assertScalarNA throws an error message, testScalarNA returns FALSE and checkScalarNA returns a string with the error message.

See Also

Other scalars: assertCount, checkCount, testCount; assertFlag, checkFlag, testFlag; assertInt, checkInt, testInt; assertNumber, checkNumber, testNumber; assertPercentage, checkPercentage, testPercentage; assertScalar, checkScalar, testScalar; assertString, checkString, testString

Examples

testScalarNA(1)
testScalarNA(NA_real_)
testScalarNA(rep(NA, 2))

[Package checkmate version 1.6.0 Index]