| make | R Documentation |
Run an R script if underlying files have changed, otherwise do nothing.
make(recipe, prereq, target, include = TRUE, engine = source,
details = FALSE, force = FALSE, recon = FALSE, quiet = TRUE, ...)
recipe |
script filename. |
prereq |
one or more files required by the script. For example, data
files, scripts, or |
target |
one or more output files produced by the script. Directory names can also be used. |
include |
whether to automatically include the script itself as a prerequisite file. This means that if the script file has been modified, it should be run. |
engine |
function to source the script. |
details |
whether to show a diagnostic table of files and time last modified. |
force |
whether to run the R script unconditionally. |
recon |
whether to return |
quiet |
whether to suppress messages. |
... |
passed to |
A make() call has the general form
make("analysis.R", "input.dat", "output.dat")
which can be read aloud as:
“script x uses y to produce z”
TRUE or FALSE, indicating whether the script was run.
This function provides functionality similar to makefile rules, to determine whether a script should be (re)run or not.
If any target is either missing or is older than any prereq,
then the script is run.
Stallman, R. M. et al. An introduction to makefiles. Chapter 2 in the GNU Make manual.
source runs any R script, source.taf is more
convenient for running a TAF script, and source.all runs all
TAF scripts.
make, make.taf, and make.all are
similar to the source functions, except they avoid repeating tasks
that have already been run.
TAF-package gives an overview of the package.
The makeit package provides a similar make function, along with
a vignette containing annotated examples and a discussion.
## Not run:
# Here, model.R uses input.dat, creating results.dat
make("model.R", "data/input.dat", "model/results.dat")
make("model.R", "data/input.dat", "model/results.dat", quiet=FALSE)
make("model.R", "data/input.dat", "model/results.dat", details=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.