path <- system.file("exData", package="R.rsp")
pathname <- rfile("random.txt.rsp", path=path,
output=file.path(tempdir(), "random.txt"))
print(pathname)
lines <- readLines(pathname, warn=FALSE)
cat(lines, collapse="\n")
file.remove(pathname)
# Passing arguments
path <- system.file("exData", package="R.rsp")
pathname <- rfile("random-args.txt.rsp", path=path, args=list(K=50),
output=file.path(tempdir(), "random-args.txt"))
print(pathname)
lines <- readLines(pathname, warn=FALSE)
cat(lines, collapse="\n")
file.remove(pathname)
if (FALSE) {
# Compile and display the main vignette (requires LaTeX)
if (isCapableOf(R.rsp, "latex")) {
path <- system.file("doc", package="R.rsp")
pdf <- rfile("Dynamic_document_creation_using_RSP.tex.rsp", path=path)
cat("Created document: ", pdf, "\n", sep="")
if (interactive()) browseURL(pdf)
}
}
Run the code above in your browser using DataLab