[ESS] knitr

Mathieu Basille basille at ase-research.org
Thu Jun 7 16:14:53 CEST 2012


[sorry I forgot to cc the list and other members of the discussion]

Le 07/06/2012 09:32, Yihui Xie a écrit :
> For this specific task, it is not terribly hard to do with knitr, and
> it happens that someone asked a similar question a few days ago. Here
> is my example: https://gist.github.com/2629886#file_knitr_checkpoint.rnw
>
> Basically you specify a chunk name, and knitr will evaluate all chunks
> up to that chunk.

This is an interesting feature! But not quite yet what I had in mind. 
Imagine the following case: I have a working Rnw file that I need to 
revise. I'd like to be able to Sweave/knitr/compile the document to a 
certain point, in order to check the revision from time to time. As you 
said in another message, if you stop to Sweave/knitr before the end, you 
will end up with an incomplete LaTeX document that would not compile. 
Ideally, but that's more on the ESS side, I would love to have keywords 
like @exclude and @stop-exclude to easily 'comment' large bits of R code 
AND LaTeX content that are between the keywords. Just before the 
\end{document} I generally have closing R statements (e.g. close DB 
connection, print sessionInfo, etc.), which I'd like to include anyway. But 
this could be other chunks or any LaTeX content as well.

Mathieu.


> Regards,
> Yihui
> --
> Yihui Xie<xieyihui at gmail.com>
> Phone: 515-294-2465 Web: http://yihui.name
> Department of Statistics, Iowa State University
> 2215 Snedecor Hall, Ames, IA
>
>
> On Thu, Jun 7, 2012 at 9:24 AM, Mathieu Basille
> <basille at ase-research.org>  wrote:
>>
>> I also would like very much a partial evaluation. I'm not using knitr yet
>> (lack of time, unfortunately), but this should be the same for Sweave if
>> it's going to be backend independent. I often find myself willing to Sweave
>> (and then compile) the document to a given point (usually when revising a
>> Sweave document), and skip the rest of the content of the document (that is,
>> at the exception of ending macros such as biblio, some R statements, and
>> \end{document}). Ideally, what would be great to me would be a string of
>> character to start and stop excluding any content (including LaTeX and R,
>> i.e. more general that 'eval=FALSE, echo=FALSE' in every chunk) to
>> Sweave/knittr.
>>
>> Mathieu.

-- 

~$ whoami
Mathieu Basille, Post-Doc

~$ locate
Laboratoire d'Écologie Comportementale et de Conservation de la Faune
+ Centre d'Étude de la Forêt
Département de Biologie
Université Laval, Québec

~$ info
http://ase-research.org/basille

~$ fortune
``If you can't win by reason, go for volume.''
Calvin, by Bill Watterson.



More information about the ESS-help mailing list