Hello, I try to document some R scripts for my collegues and observed the problem, that Sweave strips comment lines away. As a small example I write in an Rtex file: \begin{Scode} ## a small example test() # line comment \end{Scode} ... the .tex file generated by Sweave only contains: \begin{Schunk} \begin{Sinput} test() \end{Sinput} \end{Schunk} ... and all the comments are lost. Looking into the archives, I found, that such a question appeared already some months ago. Are there any advances or workarounds doing such things today? Thank you in advance! Thomas P.
Hi! I observed it also. There are cases where it is not desirable. It will be quite helpfull, if possible, to have a parameter that allows one to switch of removing the #comments. /E *********** REPLY SEPARATOR *********** On 9/6/2004 at 1:30 PM Thomas Petzoldt wrote:>>>Hello, >>> >>>I try to document some R scripts for my collegues and observed the >>>problem, that Sweave strips comment lines away. >>> >>>As a small example I write in an Rtex file: >>> >>>\begin{Scode} >>>## a small example >>>test() # line comment >>>\end{Scode} >>> >>>... the .tex file generated by Sweave only contains: >>> >>>\begin{Schunk} >>>\begin{Sinput} >>> test() >>>\end{Sinput} >>>\end{Schunk} >>> >>> >>>... and all the comments are lost. Looking into the archives, I found, >>>that such a question appeared already some months ago. Are there any >>>advances or workarounds doing such things today? >>> >>>Thank you in advance! >>> >>>Thomas P. >>> >>>______________________________________________ >>>R-help@stat.math.ethz.ch mailing list >>>https://stat.ethz.ch/mailman/listinfo/r-help >>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.htmlDipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic Ihnestrasse 63-73 14195 Berlin 'v' tel: 0049-30-83875219 / \ mail: witek96@users.sourceforge.net ---W-W---- http://www.molgen.mpg.de/~wolski wolski@molgen.mpg.de
Friedrich.Leisch@tuwien.ac.at
2004-Sep-13 10:01 UTC
[Rd] Re: [R] Sweave echoing comments (again)
>>>>> On Wed, 08 Sep 2004 17:46:51 +0200, >>>>> Wolski (W) wrote:> Hi! > I observed it also. There are cases where it is not desirable. It > will be quite helpfull, if possible, to have a parameter that > allows one to switch of removing the #comments. The problem is that the parser does not keep the comments, and I need to parse & deparse the source in order to know when expressions are complete, such that I can insert the ourtput in the right places. Currently there is no way of keepng the comments in Sweave code chunks. Best, Fritz PS: I am promising a workaround for quite some time now, but haven't had the time to code that yet, so don't hold your breath.