R-alpha: terms

Thomas Lumley (thomas@biostat.washington.edu)
Sat, 14 Sep 1996 20:47:41 -0700 (PDT)

Date: Sat, 14 Sep 1996 20:47:41 -0700 (PDT)
From: Thomas Lumley <thomas@biostat.washington.edu>
To: r-testers <r-testers@stat.math.ethz.ch>
Subject: R-alpha: terms
In-Reply-To: <Pine.SUN.3.91.960913113316.19284G-100000@chekov>

terms.formula() does not do the same thing as in S.

In S it returns a list with a component corresponding to each term in the 
RHS of the formula. In R there is only one component for the RHS.

This is important in including things like offsets, weights, strata and 
clusters in formulas -- they need to be removed from the formula after the 
model.frame is constructed but before the model.matrix is constructed. In 
S these things can be located in the formula using the "specials" 
facility (which works fine in R) and then removed by subsetting.  
Removing them after the matrix has  been made is much messier as it 
involves knowing how many columns correspond to each term in the formula.

thomas lumley
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch