delete.response {base} | R Documentation |
Modify Terms Objects
Description
delete.response
returns a terms
object for the same
model but with no response variable.
drop.terms
removes variables from the right-hand side of the
model.
reformulate
creates a formula from a vector of strings.
Usage
delete.response(termobj)
reformulate(termlabels,response=NULL)
drop.terms(termobj, dropx = NULL, keep.response = FALSE)
Arguments
termobj |
A |
termlabels |
vector of strings giving the right-hand side of a model formula |
response |
string giving the left-hand side of a model formula |
dropx |
vector of positions of variables to drop from the right-hand side of the model |
keep.response |
Keep the response in the resulting object? |
Value
delete.response
and drop.terms
return a terms
object.
reformulate
returns a formula
.
See Also
terms
Examples
ff <- y ~ z + x + w
tt <- terms(ff)
tt
delete.response(tt)
drop.terms(tt, 2:3, keep.response = T)
reformulate(attr(tt, "term.labels"))