EVOLUTION-MANAGER
Edit File: knit_watch.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Watch an input file continuously and knit it when it is...</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for knit_watch {knitr}"><tr><td>knit_watch {knitr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Watch an input file continuously and knit it when it is updated</h2> <h3>Description</h3> <p>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. </p> <h3>Usage</h3> <pre> knit_watch(input, compile = knit, interval = 1, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>input</code></td> <td> <p>An input file path, or a character vector of mutiple input file paths.</p> </td></tr> <tr valign="top"><td><code>compile</code></td> <td> <p>A function to compile the <code>input</code> file. This could be e.g. <code><a href="knit.html">knit</a></code> or <code><a href="knit2pdf.html">knit2pdf</a></code>, depending on the input file and the output you want.</p> </td></tr> <tr valign="top"><td><code>interval</code></td> <td> <p>A time interval to pause in each cycle of the infinite loop.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Other arguments to be passed to the <code>compile</code> function.</p> </td></tr> </table> <h3>Details</h3> <p>This is actually a general function not necessarily restricted to applications in <span class="pkg">knitr</span>. You may specify any <code>compile</code> function to process the <code>input</code> file. To stop the infinite loop, press the <span class="samp">Escape</span> key or <span class="samp">Ctrl + C</span> (depending on your editing environment and operating system). </p> <h3>Examples</h3> <pre> # knit_watch('foo.Rnw', knit2pdf) # knit_watch('foo.Rmd', rmarkdown::render) </pre> <hr /><div style="text-align: center;">[Package <em>knitr</em> version 1.29 <a href="00Index.html">Index</a>]</div> </body></html>