RevolutionAnalytics / checkpoint

Install R packages from snapshots on checkpoint-server
164 stars 38 forks source link

If chunk option 'eval' is set to a variable, checkpoint fails #195

Closed renlund closed 9 years ago

renlund commented 9 years ago

A .rnw-file like this (call it "test.rnw") :

\documentclass{article}
\begin{document}
<<foo, cache = FALSE>>=
library(knitr)
x <- FALSE
@

<<bar, eval = x>>=
1+1
@
\end{document}

is fine for knitr::knit("test.rnw"). (In the "foo"-chunk a variable x is defined to determine wether the "bar"-chunk should be evaluated.) However, checkpoint::checkpoint("test.rnw") fails since it is unable to parse this file - which I assume is due to utils::Stangle("test.rnw") also failing.

Would it be perhaps be possible to get the option to use knitr::purl for parsing the .rnw files instead? knitr::purl("test.rnw") does produce an output.

andrie commented 9 years ago

I confirm this is reproducible

andrie commented 9 years ago

Initial analysis indicates that it would be viable to use knitr() to parse Rnw files instead of SWeave()

andrie commented 9 years ago

The new version contains better error handling when using SWeave() - still the default.

In addition, you can now use the argument scan.rnw.with.knitr to force checkpoint() to use knitr::knit() to scan .Rnw files.

renlund commented 9 years ago

That sounds excellent. Thank you.