[Rd] long formulas in terms() (PR#873)
Thomas Lumley
tlumley@u.washington.edu
Thu, 8 Mar 2001 13:57:41 -0800 (PST)
On Thu, 8 Mar 2001 jerome@stat.ubc.ca wrote:
> Full_Name: Jerome Asselin
> Version: 1.2.2
> OS: Windows 95
> Submission from: (NULL) (142.52.81.1)
>
>
>
> I need to use the "terms()" function to decompose a formula.
> The function seems to work for small formulas, but not for long formulas.
>
<snip>
> I noticed that when the left-hand side term of the formula is
> too large to be written on one line, an error occurs in terms().
> However, increasing the line width by "options(width=200)" did
> not solve the problem.
The problem is in fixFormulaObject in terms.formula(). It uses deparse()
on the lhs of the formula.
A work-around is to change the line near the top of fixFormulaObject in
terms.formula from
else deparse(form[[2]])
to
else deparse(form[[2]],width.cutoff=200)
but this may not be the final solution -- we should have something without
a width limit
-thomas
Thomas Lumley Asst. Professor, Biostatistics
tlumley@u.washington.edu University of Washington, Seattle
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._