sourceAllRsp

0th

Percentile

Processes one or several RSP files

Processes one or several RSP files.

Keywords
internal, file, IO
Usage
## S3 method for class 'default':
sourceAllRsp(pattern="[.]rsp$", path=".", extension="html", outputPath=extension, overwrite=FALSE, ..., envir=parent.frame())
Arguments
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 FALSE, an error is thrown if an output file already exists, otherwise not.
...
Additional arguments passed to sourceRsp().
envir
An environment to be the working environment of the servlets, i.e. where RSP variables and objects are stored.
Value

  • Returns (invisibly) a character list of pathnames of all processed RSP files.

Exceptions

If an exception occurs while processing a file, the methods skips to the next one and records the error.

See Also

sourceRsp().

Aliases
  • sourceAllRsp.default
  • sourceAllRsp
Examples
# Copy the complete directory tree contain RSP files
rspPath <- system.file("rsp", package="R.rsp")
cat("RSP directory: ", rspPath, "")

# Create an output path to contain HTML files
outputPath <- tempdir()
cat("HTML directory: ", outputPath, "")

# Process all RSP files (not recursively)
files <- sourceAllRsp(path=rspPath, outputPath=outputPath, extension="html")

cat("Processed the following RSP files:
")
print(files)

# View generated documents
if (interactive()) {
  library(tools)
  indexFile <- filePath(outputPath, "index.html")
  cat("Trying to open '", indexFile, "' in default browser...
", sep="")
  browseURL(getAbsolutePath(indexFile))
}
Documentation reproduced from package R.rsp, version 0.7.1, License: LGPL (>= 2.1)

Community examples

Looks like there are no examples yet.