| checkInt {checkmate} | R Documentation |
Check if an argument is a single integerish value
checkInt(x, na.ok = FALSE, lower = -Inf, upper = Inf, tol = sqrt(.Machine$double.eps)) assertInt(x, na.ok = FALSE, lower = -Inf, upper = Inf, tol = sqrt(.Machine$double.eps), .var.name) testInt(x, na.ok = FALSE, lower = -Inf, upper = Inf, tol = sqrt(.Machine$double.eps))
x |
[any] |
na.ok |
[ |
lower |
[ |
upper |
[ |
tol |
[ |
.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, assertInt throws an error message,
testInt returns FALSE and checkInt returns
a string with the error message.
Other scalars: assertCount,
checkCount, testCount;
assertFlag, checkFlag,
testFlag; assertNumber,
checkNumber, testNumber;
assertPercentage,
checkPercentage,
testPercentage;
assertScalarNA,
checkScalarNA, testScalarNA;
assertScalar, checkScalar,
testScalar; assertString,
checkString, testString
testInt(1) testInt(-1, lower = 0)