Checks if term using vld_term()
or vld_term_rcrd()
.
chk_term(x, validate = "complete", x_name = NULL)
chk_term_rcrd(x, validate = "complete", x_name = NULL)
NULL
, invisibly. Called for the side effect of throwing an error
if the condition is not met.
chk_term_rcrd()
: Check Term Record
# chk_term
x <- term("x[2]", "x[1]")
chk_term(x)
x <- c("x[2]", "x[1]")
try(chk_term(x, validate = "sorted"))
#> Error in vld_term(x, validate = validate) :
#> `validate` must match 'class', 'complete', 'consistent' or 'valid', not 'sorted'.
# chk_term_rcrd
x <- term_rcrd("x[2]", "x[1]")
chk_term_rcrd(x)
x <- c("x[2]", "x[1]")
try(chk_term_rcrd(x, validate = "sorted"))
#> Error in vld_term_rcrd(x, validate = validate) :
#> `validate` must match 'complete', 'consistent' or 'valid', not 'sorted'.