checkNull | R Documentation |
Check if an argument is NULL
checkNull(x)
check_null(x)
assertNull(x, .var.name = vname(x), add = NULL)
assert_null(x, .var.name = vname(x), add = NULL)
testNull(x)
test_null(x)
x |
[any] |
.var.name |
[ |
add |
[ |
Depending on the function prefix:
If the check is successful, the functions
assertNull
/assert_null
return
x
invisibly, whereas
checkNull
/check_null
and
testNull
/test_null
return
TRUE
.
If the check is not successful,
assertNull
/assert_null
throws an error message,
testNull
/test_null
returns FALSE
,
and checkNull
/check_null
return a string with the error message.
The function expect_null
always returns an
expectation
.
Other basetypes:
checkArray()
,
checkAtomic()
,
checkAtomicVector()
,
checkCharacter()
,
checkComplex()
,
checkDataFrame()
,
checkDate()
,
checkDouble()
,
checkEnvironment()
,
checkFactor()
,
checkFormula()
,
checkFunction()
,
checkInteger()
,
checkIntegerish()
,
checkList()
,
checkLogical()
,
checkMatrix()
,
checkNumeric()
,
checkPOSIXct()
,
checkRaw()
,
checkVector()
testNull(NULL)
testNull(1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.