Last chance! 50% off unlimited learning
Sale ends in
Compiles an RSP document and returns the generated source code script.
# S3 method for default
rcode(..., file=NULL, path=NULL, output=NULL, workdir=NULL, envir=parent.frame(),
args="*", verbose=FALSE)
Returns an RspFileProduct
if possible,
otherwise an RspSourceCode
.
character
strings with RSP markup.
Alternatively, a file, a URL or a connection
from
with the strings are read.
If a file, the path
is prepended to the file, iff given.
A character
string or a connection
specifying where
output should be directed.
The default is a file with a filename where the file extension(s)
(typically ".*.rsp"
) has been replaced by ".R"
in the directory given by the workdir
argument.
The working directory to use after parsing and
preprocessing.
If argument output
specifies an absolute pathname,
then the directory of output
is used, otherwise the
current directory is used.
The environment
in which the RSP string is
preprocessed and evaluated.
A named list
of arguments assigned to the environment
in which the RSP string is parsed and evaluated.
See cmdArgs
.
See Verbose
.
Henrik Bengtsson
rcat
() and rfile
().
# RSP-embedded text to an R script
code <- rcode("Current time is <%=Sys.time()%>\n")
cat(code, sep="\n")
# RSP-embedded text to a shell script
code <- rcode("Current time is <%=date%>\n", language="sh")
cat(code, sep="\n")
Run the code above in your browser using DataLab