term {term} | R 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 ]")
[Package term version 0.3.5 Index]