DebuggingKnitr

Developing and debugging knitr programs

If the resources need to run a knitr program is only available on some remote server or even a cluster where you can not run R interactively, or perhaps only in a terminal, or perhaps not in your preferred IDE, how do you develop and debug the program?

Smart use of lazyLoad() on the cache conveniently restores the state, so as long as you can aquire file system access to that directory you should be good to go.

This idiom to restore the state given the cache dir is as follows:

my.files <- list.files(path="cache", pattern="*.rdx", recursive=TRUE, full.name=TRUE)
for(file in my.files){
 lazyLoad(substring(file, 1, nchar(file)-4))
}

Note that you have to load libraries manually.

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: februari 11, 2024