Learn R Programming

term (version 0.1.0)

chk_term: Check Term

Description

Checks if term using [vld_term](x).

Usage

chk_term(x, validate = "class", x_name = NULL)

Arguments

x

The object to check.

validate

A string specifying the level of the validation. The possible values in order of increasing strictness are 'class', 'valid', 'consistent' and 'complete'.

x_name

A string of the name of object x or NULL.

Value

NULL, invisibly. Called for the side effect of throwing an error if the condition is not met.

Examples

Run this code
# NOT RUN {
x <- as.term(c("x[2]", "x[1]"))
chk_term(x)
x <- c("x[2]", "x[1]")
try(chk_term(x, validate = "sorted"))
# }

Run the code above in your browser using DataLab