[R] SweaveOpts(eval=false) not working - CORRECTION
Friedrich Leisch
friedrich.leisch at stat.uni-muenchen.de
Fri Jul 24 12:30:38 CEST 2009
>>>>> On Thu, 23 Jul 2009 15:09:47 +0200,
>>>>> Rainer M Krug (RMK) wrote:
> On Thu, Jul 23, 2009 at 3:04 PM, Duncan Murdoch<murdoch at stats.uwo.ca> wrote:
>> On 23/07/2009 8:58 AM, Rainer M Krug wrote:
>>>
>>> Hi
>>>
>>> I hope this is the right mailing list - if not, could you please refer
>>> me to a mora appropriate?
>>>
>>> My question:
>>>
>>> I am using sweave (in LyX with beamer) for a lecture and I would like
>>> to evaluate the R code chunks for the handout, but not for the
>>> presentation.
>>> I thought that I can use \SweaveOpts(eval=FALSE) to set this option
>>> for all code chunks, but it is still evaluating them and showing the
>>> output. If I set this option separately for each chunk(i.e.
>>> <<eval=FALSE>>=), it is, as expected, not evaluating.
>>>
>>> Am I doing something wrong here or is there a bug in sveawe, so that
>>> it is not axcepting eval=FALSE as a global option?
>>
>> Looks like you used parentheses () instead of braces {} in the \SweaveOpts
>> line. Even though LaTeX never sees it, it uses LaTeX-like syntax.
> Sorry - typo in the email. In the preamble, it says:
> \SweaveOpts{keep.source=FALSE, echo=TRUE, eval=FALSE, height=4}
I cannot reproduce the problem, the minimal Rnw file
**********************************************************
\documentclass[a4paper]{article}
\SweaveOpts{keep.source=FALSE, echo=TRUE, eval=FALSE, height=4}
\begin{document}
<<>>=
print(1:10)
@
\end{document}
**********************************************************
produces as expected
**********************************************************
\documentclass[a4paper]{article}
\usepackage{Sweave}
\begin{document}
\begin{Schunk}
\begin{Sinput}
> print(1:10)
\end{Sinput}
\end{Schunk}
\end{document}
**********************************************************
for me, no evaluation happening. If I change to eval=TRUE then I get
printed output.
Best,
Fritz
--
-----------------------------------------------------------------------
Prof. Dr. Friedrich Leisch
Institut für Statistik Tel: (+49 89) 2180 3165
Ludwig-Maximilians-Universität Fax: (+49 89) 2180 5308
Ludwigstraße 33
D-80539 München http://www.statistik.lmu.de/~leisch
-----------------------------------------------------------------------
Journal Computational Statistics --- http://www.springer.com/180
Münchner R Kurse --- http://www.statistik.lmu.de/R
More information about the R-help
mailing list