[R] Sweave line length
keithlj at suddenlink.net
Tue Oct 30 14:36:38 CET 2007
Your suggestion got me on the right track. The R command:
option(width=50), sets the text width for R to 50 columns per line.
When Sweave is run it breaks lines into 50 columns per line. The
only exception to this is when there is a command like
II/MathematicaFiles/PointPatternAnalysis/") it keeps the line in one
piece. It will not break a line in between the quotes in a line. I
will have to do that myself. 95% of the lines coded is a lot better
>Keith Jones wrote:
>> I am trying to add R code to my dissertation and the length of a line
>> of text that Sweave generates is longer than the right margin in my
>> dissertation. I have found no way to tell Sweave how to set the line
>> length. I am using an iMac with tiger ver. 10.4.10, and R: ver.
>> 2.5.1. Here is the R code that is longer than my right margin:
>> input to Sweave:
>> legend("topleft",c("obs", "theo","hi","lo"),lty =
>> c(1,2,3,4),col=c(1,2,6,4,0), cex=1.5,pt.cex=c(3,6), bty='o',inset=.05)
>> output from Sweave:
>>> legend("topleft", c("obs", "theo", "hi", "lo"), lty = c(1, 2, 3,
>>> 4), col = c(1,
>> + 2, 6, 4, 0), cex = 1.5, pt.cex = c(3, 6), bty = "o", inset = 0.05)
>> The line is about eleven (11) characters too long.
>> Keith Jones
>I'm not sure if it affects the echoed commands too, but inserting a code
>(replace 60 with the width you need) controls the width of the R output.
>Kevin E. Thorpe
>Biostatistician/Trialist, Knowledge Translation Program
>Assistant Professor, Department of Public Health Sciences
>Faculty of Medicine, University of Toronto
>email: kevin.thorpe at utoronto.ca Tel: 416.864.5776 Fax: 416.864.6057
More information about the R-help