# 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))
}
Run the code above in your browser using DataLab