Run a TAF script and return to the original directory.
sourceTAF(script, rm = FALSE, clean = TRUE, quiet = FALSE)
script filename.
whether to remove all objects from the global environment before and after the script is run.
whether to clean
the target directory before
running the script.
whether to suppress messages reporting progress.
TRUE
or FALSE
, indicating whether the script ran without
errors.
The default value of rm = FALSE
is to protect users from accidental
loss of work, but the TAF server always runs with rm = TRUE
to make
sure that only files, not objects, are carried over between scripts.
Likewise, the TAF server runs with clean = TRUE
to make sure that the
script starts with a clean directory. The target directory of a TAF script
has the same filename prefix as the script: data.R
creates data
etc.
source
is the base function to run R scripts.
makeTAF
runs a TAF script if needed.
sourceAll
runs all TAF scripts in a directory.
icesTAF-package
gives an overview of the package.
# NOT RUN {
write("print(pi)", "script.R")
source("script.R")
sourceTAF("script.R")
file.remove("script.R")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab