Skip to content
Prev 5466 / 398502 Next

Variable names in model formula

On Tue, 02 May 2000 17:11:52 +1000, Bill Venables wrote in message
<3.0.32.20000502171151.0126c440 at pophost.nsw.cmis.csiro.au>:
I just discovered a nice way to do this in S-PLUS the other day; it
doesn't work in R 0.99, but I don't have version 1 installed on this
machine to check there.

The terms() function in S-PLUS returns an expression listing the terms
in a model formula.  It is nice to manipulate:

 formula(terms(somefit)[1]) gives the model formula using just the
first term,

 formula(terms(somefit)[-1]) gives the model formula leaving out the
first term, 

etc.

I don't know if copying this functionality would break anything (or
maybe it's already there in 1.x), but it seems to me like a nice
addition.

Duncan Murdoch
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._