R knitr: is it possible to use cached results on different machines?

The problem is solved , see answers for more details.

I would like to run some code (with knitr ) on a more powerful server, and then maybe be able to make small changes on my own laptop. Even copying across the entire folder seems like the cache is rebuilt when recompiling locally, is there a way to avoid this and actually use the results in the cache?

+5
source share
2 answers

Update: The problem arose from different versions of knitr on different machines.


In theory, yes - if you do not change anything, the cache will be saved. In practice, you need to carefully check what β€œsmall changes” are. The cache documentation page explained when the cache will be rebuilt, and you need to check if all three conditions are met.

+5
source

Interestingly, in addition to @Yihui, answer if the process of copying from one machine to another changes the dates in the files so that they look outdated even when nothing has changed.

See the dates in the files associated with the copy. If you can determine which files should be newer than others, then touch them can prevent recovery.

Another option is to simply insert the pieces directly so that they do not repeat (although this means that you need to restart and soak manually if you change anything in these parts).

0
source

All Articles