checkDate {checkmate} | R Documentation |
Check that an argument is a Date
Description
Checks that an object is of class Date
.
Usage
checkDate(
x,
lower = NULL,
upper = NULL,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
null.ok = FALSE
)
check_date(
x,
lower = NULL,
upper = NULL,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
null.ok = FALSE
)
assertDate(
x,
lower = NULL,
upper = NULL,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
null.ok = FALSE,
.var.name = vname(x),
add = NULL
)
assert_date(
x,
lower = NULL,
upper = NULL,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
null.ok = FALSE,
.var.name = vname(x),
add = NULL
)
testDate(
x,
lower = NULL,
upper = NULL,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
null.ok = FALSE
)
test_date(
x,
lower = NULL,
upper = NULL,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
null.ok = FALSE
)
expect_date(
x,
lower = NULL,
upper = NULL,
any.missing = TRUE,
all.missing = TRUE,
len = NULL,
min.len = NULL,
max.len = NULL,
unique = FALSE,
null.ok = FALSE,
info = NULL,
label = vname(x)
)
Arguments
x |
[any] |
lower |
[ |
upper |
[ |
any.missing |
[ |
all.missing |
[ |
len |
[ |
min.len |
[ |
max.len |
[ |
unique |
[ |
null.ok |
[ |
.var.name |
[ |
add |
[ |
info |
[ |
label |
[ |
Value
Depending on the function prefix:
If the check is successful, the functions
assertAtomic
/assert_atomic
return
x
invisibly, whereas
checkAtomic
/check_atomic
and
testAtomic
/test_atomic
return
TRUE
.
If the check is not successful,
assertAtomic
/assert_atomic
throws an error message,
testAtomic
/test_atomic
returns FALSE
,
and checkAtomic
/check_atomic
return a string with the error message.
The function expect_atomic
always returns an
expectation
.
See Also
Other basetypes:
checkArray()
,
checkAtomic()
,
checkAtomicVector()
,
checkCharacter()
,
checkComplex()
,
checkDataFrame()
,
checkDouble()
,
checkEnvironment()
,
checkFactor()
,
checkFormula()
,
checkFunction()
,
checkInteger()
,
checkIntegerish()
,
checkList()
,
checkLogical()
,
checkMatrix()
,
checkNull()
,
checkNumeric()
,
checkPOSIXct()
,
checkRaw()
,
checkVector()