terms(formula, specials, abb = NULL, data, neg.out = T, keep.order = F) as.terms(object)
The function as.terms leaves term objects alone, and converts formula objects, and a variety of objects that contain formulas as components or attributes, by calling terms.
terms(Yield~Temp*Conc+Error(blocks),specials="Error")# Produces the following output: expression(Temp, Conc, Error(blocks), Temp:Conc) attr(, "formula"): Yield ~ Temp * Conc + Error(blocks) attr(, "factors"): Temp Conc Error(blocks) Temp:Conc Yield 0 0 0 0 Temp 1 0 0 1 Conc 0 1 0 1 Error(blocks) 0 0 1 0 attr(, "order"): [1] 1 1 1 2 attr(, "variables"): expression(Yield, Temp, Conc, Error(blocks)) attr(, "term.labels"): [1] "Temp" "Conc" "Error(blocks)" "Temp:Conc" attr(, "intercept"): [1] 1 attr(, "response"): [1] 1 attr(, "specials"): attr(, "specials")$Error: [1] 4
attr(, "class"): [1] "terms"
# an example of keep.order = T aov.with.means <- aov(terms(Weight~Trans1:Trans2+Tires-1, keep.order = T), cu.specs)