# terms.object

##### Description of Terms Objects

An object of class `terms`

holds information about a
model. Usually the model was specified in terms of a
`formula`

and that formula was used to determine the terms
object.

- Keywords
- models

##### Value

The object itself is simply the formula supplied to the call of
`terms.formula`

. The object has a number of attributes
and they are used to construct the model frame:

`numeric(0)`

.`list`

of the variables in the model.`term.labels`

indicating the order of interaction for each term.`offset`

terms there
is an `offset`

attribute indicating which variable(s) are offsets`specials`

argument was given to
`terms.formula`

there is a `specials`

attribute, a
pairlist of vectors (one for each specified special function) giving
numeric indices of the arguments of the list returned as the
`variables`

attribute which contain these special functions.`.MFclass`

) of the variables used in a fit.`makepredictcall`

.`c("terms", "formula")`

.
##### Note

These objects are different from those found in S. In particular
there is no `formula`

attribute: instead the object is itself a
formula. (Thus, the mode of a terms object is different.) Examples of the `specials`

argument can be seen in the
`aov`

and `coxph`

functions, the
latter from package survival">https://CRAN.R-project.org/package=survival.

##### See Also

##### Examples

`library(stats)`

```
## use of specials (as used for gam() in packages mgcv and gam)
(tf <- terms(y ~ x + x:z + s(x), specials = "s"))
## Note that the "factors" attribute has variables as row names
## and term labels as column names, both as character vectors.
attr(tf, "specials") # index 's' variable(s)
rownames(attr(tf, "factors"))[attr(tf, "specials")$s]
## we can keep the order by
terms(y ~ x + x:z + s(x), specials = "s", keep.order = TRUE)
```

*Documentation reproduced from package stats, version 3.3.3, License: Part of R 3.3.3*

### Community examples

Looks like there are no examples yet.