Hi, In the Sweave output for summary for several types of model objects and also for the comparison of models with anova, I find that that the display of the call(s) or formula does not obey the width option, even with keep.source=TRUE set, so that a long formula will overshoot the margins in the document. I would like to know if there is a good way to correct that. Looking at the print.summary methods for lm, glm and several others, I see that a construct like deparse(obj$call) is used to generate the text. The deparse function takes a "width.cutoff" argument, that could be used in these cases, if it were possible to pass a value to it, or if its default value could be set with an option. Other methods do not use deparse, (print.summary.polr in MASS uses dput and anovalist.nls also does it differently) so such a solution would not work universally without altering these functions.
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} I have attached the pdf output. Thanks, in advance, for any suggestions. Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr/members/kenneth-knoblauch.html ----------------------------------------------------------------
TmpTest.pdf
Description: Adobe PDF document
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.