knit_watch

0th

Percentile

Watch an input file continuously and knit it when it is updated

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.

Usage
knit_watch(input, compile = knit, interval = 1, ...)
Arguments
input

An input file path, or a character vector of mutiple input file paths.

compile

A function to compile the input file. This could be e.g. knit or knit2pdf, depending on the input file and the output you want.

interval

A time interval to pause in each cycle of the infinite loop.

...

Other arguments to be passed to the compile function.

Details

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).

Aliases
  • knit_watch
Examples
# NOT RUN {
# knit_watch('foo.Rnw', knit2pdf)

# knit_watch('foo.Rmd', rmarkdown::render)
# }
Documentation reproduced from package knitr, version 1.22, License: GPL

Community examples

Looks like there are no examples yet.