| rsp {R.rsp} | R Documentation |
Compiles an RSP document.
## Default S3 method: rsp(filename=NULL, path=NULL, text=NULL, response=NULL, ..., envir=parent.frame(), outPath=".", postprocess=TRUE, verbose=FALSE)
filename, path |
The filename and (optional) path of the RSP document to be compiled. |
text |
A |
response |
Specifies where the final output should be sent.
If argument |
... |
Additional arguments passed to the type-specific compiler. |
envir |
The |
outPath |
The output and working directory. |
postprocess |
If |
verbose |
See |
If argument response specifies a file output, then the
absolute pathname of the generated file is returned.
If argument text is specified, then the generated string
is returned (invisibly).
For some document types, the rsp() method automatically
postprocesses the generated document as well.
Henrik Bengtsson
## Not run:
# EXAMPLE #1: Output random number
rsp(text="A random number in [1,100]: <%=sample(1:100, size=1)%>\n")
# EXAMPLE #2: Assign and output random number
rsp(text="A random number in [1,100]: <%= x <- sample(1:100, size=1); %>\n")
cat(sprintf("The random number generated by the RSP document was: %d\n", x))
## End(Not run)