Learn R Programming

term (version 0.1.0)

repair_terms: Repair Terms

Description

Repairs a terms vector.

Usage

repair_terms(x)

Arguments

x

The object.

Value

The repaired term vector.

Details

Invalid elements are replaced by missing values and spaces removed.

If a parameter such as b is a scalar then b[1] is replaced by b but if higher indices are included such as b[2] then b is replaced by b[1].

See Also

term-vector() and valid_term()

Examples

Run this code
# NOT RUN {
repair_terms(as.term(c("b[3]", "b")))
repair_terms(as.term(c("a[3]", "b[1]")))
repair_terms(as.term(c("a [3]", " b [ 1  ] ")))
repair_terms(as.term(c("a", NA)))
# }

Run the code above in your browser using DataLab