Check if an argument is a vector of type logical
Check if an argument is a vector of type logical
checkLogical( x, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, names = NULL, null.ok = FALSE ) check_logical( x, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, names = NULL, null.ok = FALSE ) assertLogical( 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_logical( 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 ) testLogical( x, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, names = NULL, null.ok = FALSE ) test_logical( x, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, names = NULL, null.ok = FALSE ) expect_logical( 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
assertLogical
/assert_logical
return
x
invisibly, whereas
checkLogical
/check_logical
and
testLogical
/test_logical
return
TRUE
.
If the check is not successful,
assertLogical
/assert_logical
throws an error message,
testLogical
/test_logical
returns FALSE
,
and checkLogical
returns a string with the error message.
The function expect_logical
always returns an
expectation
.
Other basetypes:
checkArray()
,
checkAtomicVector()
,
checkAtomic()
,
checkCharacter()
,
checkComplex()
,
checkDataFrame()
,
checkDate()
,
checkDouble()
,
checkEnvironment()
,
checkFactor()
,
checkFormula()
,
checkFunction()
,
checkIntegerish()
,
checkInteger()
,
checkList()
,
checkMatrix()
,
checkNull()
,
checkNumeric()
,
checkPOSIXct()
,
checkRaw()
,
checkVector()
testLogical(TRUE) testLogical(TRUE, min.len = 1)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.