| sourceRsp {R.rsp} | R Documentation |
Processes an RSP file by translating it to an R servlet, which is then sourced.
## Default S3 method: sourceRsp(..., response=FileRspResponse(file = stdout()), request=NULL, envir=parent.frame(), verbose=FALSE)
... |
Arguments passed to |
response |
An |
request |
An optional |
envir |
An |
verbose |
Either a |
When "sourcing" an RSP file, the RSP code is first translated to an R servlet, which is plain R source code. Then the servlet is sourced, and it in turns outputs the final response, e.g. an HTML document.
Returns what the R servlet code returns.
Henrik Bengtsson
translateRspV1().
sourceAllRsp().
## Not run:
# The RSP file
rspPath <- system.file("rsp/rsp/docs", package="R.rsp")
rspFile <- file.path(rspPath, "helloWorld.html.rsp")
file.show(rspFile)
# The HTML (output) file
outPath <- tempdir()
response <- FileRspResponse(file="helloWorld.html", path=outPath)
# Process RSP file
sourceRsp(file=rspFile, response=response)
# View generated document
file.show(getOutput(response))
## End(Not run)