term: Create Term Vector

View source: R/term.R

termR Documentation

Create Term Vector

Description

Creates a term vector from values. A term vector is an S3 vector of parameter terms of the form p, q[#] or r[#,#] where # are positive integers. This function checks that all terms are valid but does not require stronger levels of consistency, see chk_valid() for details.

Usage

term(...)

Arguments

...

Unnamed values are term values, named values describe the parameter in the name and the dimensionality in the value.

Value

A term vector.

See Also

dims(), ndims(), npdims() and pdims()

Other term: term_rcrd(), tindex()

Examples

term()
term("p", "q[1]", "q[2]", "q[3]")
term("q[1]", "q[2]", "q[3]")
combined <- term(par = 2:4, "alpha")
pdims(combined)
term(!!!pdims(combined))

# Invalid terms are rejected:
try(term("r["))

# Valid terms are repaired
term("r  [ 1  ,2  ]")

term documentation built on Sept. 29, 2022, 5:14 p.m.

Related to term in term...