FILE <- tempfile(fileext = ".R")
this.path:::write.code({
withAutoprint({
shFILE(original = TRUE)
shFILE()
shFILE(default = {
stop("since 'FILE' will be found, argument 'default' will not\n",
" be evaluated, so this error will not be thrown! you can\n",
" use this to your advantage in a similar manner, doing\n",
" arbitrary things only if 'FILE' is not found")
})
}, spaced = TRUE, verbose = FALSE, width.cutoff = 60L)
}, FILE)
this.path:::.Rscript(c("--default-packages=this.path", "--vanilla", FILE))
for (expr in c("shFILE(original = TRUE)",
"shFILE(original = TRUE, default = NULL)",
"shFILE()",
"shFILE(default = NULL)"))
{
cat("\n\n")
this.path:::.Rscript(c("--default-packages=this.path", "--vanilla", "-e", expr))
}
unlink(FILE)
Run the code above in your browser using DataLab