[R] overshoot of formula line in summary output of Sweave

Ken Knoblauch ken.knoblauch at inserm.fr
Fri Jun 19 11:09:03 CEST 2009


Ben Bolker <bolker <at> ufl.edu> writes:
> >> > Here is a toy example that illustrates the overshoot of the formula
> >> > \documentclass[12pt]{article}
> >> > \usepackage{geometry}
> >> > \geometry{left=2in,right=2in}
> >> > \begin{document}
> >> > <<keep.source=TRUE>>=
> >> > op <- options(width = 65, digits = 3)
> >> > ddataframe <- data.frame(AAAAA = 1:10,
> >> > 	BBBBB = factor(letters[1:2]),
> >> > 	CCCCC = factor(LETTERS[1:5]),
> >> > 	SSSSS = factor(paste("S", 1:10, sep = "")),
> >> > 	RRRRR = rnorm(10))
> >> > 
> >> > mod1 <- lm(RRRRR ~ AAAAA + BBBBB + CCCCC + SSSSS,
> >> > 	ddataframe)
> >> > summary(mod1)
> >> > @
> >> > \end{document}
> >> A quick guess:  try keep.source=TRUE and format your commands
> >> as you would like to see them appear ...
> >>   Ben Bolker
> > Thanks, Ben, for the response.

--- deleted text ---

> 
> I wonder if there is a LaTeX-side solution, i.e. constructing a 
> verbatim-like environment that breaks lines?

It sounds a bit like an oxymoron but isn't that
more or less what Sweave does when keep.source is
not set to TRUE, only it doesn't seem to catch the
print-outs of these long calls.  I'll give your
suggestion some further thought, however.
Thanks.

Ken




More information about the R-help mailing list