[R] cacheSweave questions (usage and forward compatibility)

Yihui Xie xie at yihui.name
Thu Jan 19 15:31:29 CET 2012


Tal,

You probably need to cc the package author for reliable answers, but
my attempts are below anyway:

1) true or TRUE? I'm not exactly sure how this option is parsed
(checking the source code is one way to go), but for knitr, it does
not allow true to mean TRUE, and \SweaveOpts{cache=TRUE} should work
as expected; if cacheSweave follows the convention of Sweave strictly,
\SweaveOpts{cache=true} should have worked (true means TRUE);

2) In the past I mainly used cacheSweave via pgfSweave, and I'm more
familiar with the latter; one thing I'm sure is that it does not
delete old cache files, so if you add 1 and remove 1, it will probably
revert to the old cache and skip the evaluation, and two sets of cache
files will be there; knitr removes old cache each time the new cache
is built, so in your case, the chunk will be re-evaluated after 1 is
removed;

3) This is one of the big motivations of knitr (see the section
Motivation in http://yihui.github.com/knitr/); again, I cannot say
much about cacheSweave since I did not go through its source code as
frequently as pgfSweave's, but I know at least the latter is facing
inconsistencies with official Sweave (e.g. issues #36/#34/#25/... in
its GitHub repository);

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, Jan 19, 2012 at 4:56 AM, Tal Galili <tal.galili at gmail.com> wrote:
> Hello all,
>
> I would like to ask several questions regarding cacheSweave:
> 1) Is there a way to set "cache=true" globally? (I tried it
> using \SweaveOpts but it didn't seem to work)
>  2) Is there a way to "flush" specific cache once it is created? (other
> then erasing the entire cache directory)?  Changing the code in the code
> chunk seems to do it, but I am not sure to what extent.  For example - if I
> add at the end of the code chunk a number (say 1 - that will be printed),
> it will reevaluate the code chunk.  However, if I remove that number, it
> will not re-evaluate the code chunk.
> 3) To what extent does cacheSweave rely on Sweave? For example: I see that
> the latest Sweave document is from October 31, 2011 while the latest update
> to cacheSweave is from 2011-07-23.  Does that mean that there are new
> features or bug fixes that are introduced to Sweave which are not available
> through cacheSweave?  (from the manual it says that cacheSweave is based on
> the code version of R 2.5.0.  What does that mean in terms of
> features/bugs?)
>
> Thank you for your help,
> Tal
>
>
>
>
>
>
>
> ----------------Contact
> Details:-------------------------------------------------------
> Contact me: Tal.Galili at gmail.com |  972-52-7275845
> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> www.r-statistics.com (English)
> ----------------------------------------------------------------------------------------------
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list