| sourceAllRsp {R.rsp} | R Documentation |
Processes one or several RSP files.
## Default S3 method: sourceAllRsp(pattern="[.]rsp$", path=".", extension="html", outputPath=extension, overwrite=FALSE, ..., envir=parent.frame())
pattern |
A filename pattern. |
path |
The pathname of the directory to be search for RSP files. |
extension |
The filename extension to be used for the output files. |
outputPath |
The pathname of the directory where to save the output files. |
overwrite |
If |
... |
Additional arguments passed to |
envir |
An |
Returns (invisibly) a character list of pathnames of all processed
RSP files.
If an exception occurs while processing a file, the methods skips to the next one and records the error.
Henrik Bengtsson
sourceRsp().
## Not run:
# Copy the complete directory tree contain RSP files
rspPath <- system.file("rsp", package="R.rsp")
cat("RSP directory: ", rspPath, "\n")
# Create an output path to contain HTML files
outputPath <- tempdir()
cat("HTML directory: ", outputPath, "\n")
# Process all RSP files (not recursively)
files <- sourceAllRsp(path=rspPath, outputPath=outputPath, extension="html")
cat("Processed the following RSP files:\n")
print(files)
# View generated documents
if (interactive()) {
library(tools)
indexFile <- filePath(outputPath, "index.html")
cat("Trying to open '", indexFile, "' in default browser...\n", sep="")
browseURL(getAbsolutePath(indexFile))
}
## End(Not run)