rsp

0th

Percentile

Compiles an RSP document

Compiles an RSP document.

Keywords
file, IO
Usage
## S3 method for class 'default':
rsp(filename=NULL, path=NULL, text=NULL, response=NULL, ..., envir=parent.frame(), postprocess=TRUE, verbose=FALSE)
Arguments
filename, path
The filename and (optional) path of the RSP document to be compiled.
text
A character vector of RSP code to be processed, iff argument filename is not given.
response
Specifies where the final output should be sent. If argument text is given, then stdout() is used. Otherwise, the output defaults to that of the type-specific compiler.
...
Additional arguments passed to the type-specific compiler.
envir
The environment in which the RSP document is evaluated.
postprocess
If TRUE, and a postprocessing method exists for the generated document type, it is postprocessed as well.
verbose
See Verbose.
Value

  • Returns what the type-specific compiler returns.

Postprocessing

For some document types, the rsp() method automatically postprocesses the generated document as well.

Aliases
  • rsp.default
  • rsp
Examples
# EXAMPLE #1
rsp(text="A random number in [1,100]: <%=sample(1:100, size=1)%>
")

# EXAMPLE #2
rsp(text="A random number in [1,100] (assigned to 'x' in the workspace): <%= x <- sample(1:100, size=1); %>
")
printf("The random number generated by the RSP document was: %d
", x)

# EXAMPLE #3
path <- system.file("doc", package="R.rsp")
pathname <- rsp("Dynamic_LaTeX_reports_with_RSP.tex.rsp", path=path)
printf("Created document: %s
", pathname)
Documentation reproduced from package R.rsp, version 0.7.1, License: LGPL (>= 2.1)

Community examples

Looks like there are no examples yet.