Skip to content

Continuation string in Sweave

2 messages · Søren Højsgaard, Friedrich.Leisch@univie.ac.at

#
Dear all,
In Sweave I have a code chunk
aaa <- "Sex, Drug/Sex:W1,Drug:W1,\
    Sex:W2,Drug:W2/Sex:W1:W2,Drug:W1:W2"
which in tex code turns into
\begin{Sinput}
\end{Sinput}
meaning that the string is not split to two lines. Any suggestion about how to make Sweave break the string ?
Thanks in advance
S?ren H?jsgaard



==========================================
S?ren H?jsgaard,  PhD, Senior Scientist
Biometry Research Unit
Danish Institute of Agricultural Sciences
Research Centre Foulum, DK-8830 Tjele, Denmark
Phone: +45 8999 1703
E-mail : sorenh at agrsci.dk
Homepage : http://www.jbs.agrsci.dk/~sorenh/
#
> Dear all,
  > In Sweave I have a code chunk
  > aaa <- "Sex, Drug/Sex:W1,Drug:W1,\
  >     Sex:W2,Drug:W2/Sex:W1:W2,Drug:W1:W2"
  > which in tex code turns into
  > \begin{Sinput}
  >> aaa <- "Sex, Drug/Sex:W1,Drug:W1,\n    Sex:W2,Drug:W2/Sex:W1:W2,Drug:W1:W2"
  > \end{Sinput}
  > meaning that the string is not split to two lines. Any suggestion about how to make Sweave break the string ?


Currently there is no way: Sweave operates on the *parsed* expressions
which do not contain the newlines. It does respect options(width=...)
settings, hence you can control approximately where lines are broken
(but not exactly).

Hope this helps,
Fritz