1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
library("R.rsp")
path <- system.file("exData", package="R.rsp")
pathname <- rfile("random.txt.rsp", path=path)
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))
print(pathname)
lines <- readLines(pathname, warn=FALSE)
cat(lines, collapse="\n")
file.remove(pathname)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Various host content types
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
path <- system.file("exData", package="R.rsp")
filenames <- list.files(pattern="LoremIpsum.*.rsp$", path=path)
for (filename in filenames) {
print(filename)
pathname <- rfile(filename, path=path, verbose = TRUE)
print(pathname)
file.remove(pathname)
}
|