shFILE {this.path} | R Documentation |
Look through the command line arguments, extracting FILE from either of the following: --file=FILE or -f FILE
shFILE(default, else.)
normalized.shFILE(default, else.)
default |
if FILE was not found, this value is returned. |
else. |
missing or a function to call on the return value if FILE is found.
See |
character string, or default
if the command line argument FILE
was not found.
Both functions will save their return values; this makes them faster when called subsequent times.
For normalized.shFILE
, the path on Windows will use / as the file
separator.
this.path:::write.code(file = FILE <- tempfile(), {
withAutoprint({
shFILE()
normalized.shFILE()
normalized.shFILE(default = {
stop("interestingly enough, because 'FILE' will be found,\n",
" argument 'default' won't be evaluated, and so this\n",
" error won't actually print, isn't that neat? you can\n",
" use this to your advantage in a similar manner, doing\n",
" arbitrary things only if 'FILE' isn't found")
})
}, width.cutoff = 60L, verbose = FALSE)
})
this.path:::.Rscript(c("--default-packages=this.path", "--vanilla", FILE))
for (expr in c("shFILE()",
"shFILE(default = NULL)",
"normalized.shFILE()",
"normalized.shFILE(default = NULL)"))
this.path:::.Rscript(c("--default-packages=this.path", "--vanilla", "-e", expr))