checkComplex {checkmate} | R Documentation |
Check if an argument is a vector of type complex
checkComplex(x, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, names = NULL, null.ok = FALSE) check_complex(x, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, names = NULL, null.ok = FALSE) assertComplex(x, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, names = NULL, null.ok = FALSE, .var.name = vname(x), add = NULL) assert_complex(x, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, names = NULL, null.ok = FALSE, .var.name = vname(x), add = NULL) testComplex(x, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, names = NULL, null.ok = FALSE) test_complex(x, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, names = NULL, null.ok = FALSE) expect_complex(x, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, names = NULL, null.ok = FALSE, info = NULL, label = vname(x))
x |
[any] |
any.missing |
[ |
all.missing |
[ |
len |
[ |
min.len |
[ |
max.len |
[ |
unique |
[ |
names |
[ |
null.ok |
[ |
.var.name |
[ |
add |
[ |
info |
[character(1)] |
label |
[ |
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, the functions
assertComplex
/assert_complex
return
x
invisibly, whereas
checkComplex
/check_complex
and
testComplex
/test_complex
return
TRUE
.
If the check is not successful,
assertComplex
/assert_complex
throws an error message,
testComplex
/test_complex
returns FALSE
,
and checkComplex
returns a string with the error message.
The function expect_complex
always returns an
expectation
.
Other basetypes: checkArray
,
checkAtomic
, checkCharacter
,
checkDataFrame
, checkDate
,
checkEnvironment
,
checkFactor
, checkFunction
,
checkIntegerish
,
checkInteger
, checkList
,
checkLogical
, checkMatrix
,
checkNull
, checkNumeric
,
checkVector
testComplex(1) testComplex(1+1i)