View source: R/utils-conversion.R
knit_watch | R Documentation |
Check the modification time of an input file continously in an infinite loop. Whenever the time indicates the file has been modified, call a function to recompile the input file.
knit_watch(input, compile = knit, interval = 1, ...)
input |
An input file path, or a character vector of mutiple input file paths. |
compile |
A function to compile the |
interval |
A time interval to pause in each cycle of the infinite loop. |
... |
Other arguments to be passed to the |
This is actually a general function not necessarily restricted to
applications in knitr. You may specify any compile
function to
process the input
file. To stop the infinite loop, press the
‘Escape’ key or ‘Ctrl + C’ (depending on your editing environment
and operating system).
# knit_watch('foo.Rnw', knit2pdf)
# knit_watch('foo.Rmd', rmarkdown::render)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.