| checkScalar {checkmate} | R Documentation |
Check if an argument is a single atomic value
checkScalar(x, na.ok = FALSE) assertScalar(x, na.ok = FALSE, .var.name) testScalar(x, na.ok = FALSE)
x |
[any] |
na.ok |
[ |
.var.name |
[character(1)] |
This function does not distinguish between
NA, NA_integer_, NA_real_, NA_complex_
NA_character_ and NaN.
Depending on the function prefix:
If the check is successful, all functions return TRUE.
If the check is not successful, assertScalar throws an error message,
testScalar returns FALSE and checkScalar returns
a string with the error message.
Other scalars: assertCount,
checkCount, testCount;
assertFlag, checkFlag,
testFlag; assertInt,
checkInt, testInt;
assertNumber, checkNumber,
testNumber; assertPercentage,
checkPercentage,
testPercentage;
assertScalarNA,
checkScalarNA, testScalarNA;
assertString, checkString,
testString
testScalar(1) testScalar(1:10)