shFILE | R Documentation |
Look through the command line arguments, extracting FILE from either of the following: -f FILE or --file=FILE
shFILE(original = FALSE, for.msg = FALSE, default, else.)
original |
|
for.msg |
|
default |
if FILE is not found, this value is returned. |
else. |
missing or a function to apply if FILE is found. See
|
character string, or default
if FILE was not found.
The original and the normalized path are saved; this makes them faster when called subsequent times.
On Windows, the normalized path will use /
as the
file separator.
this.path()
, here()
FILE.R <- tempfile(fileext = ".R")
this.path:::.writeCode({
this.path:::.withAutoprint({
shFILE(original = TRUE)
shFILE()
shFILE(default = {
stop("since 'FILE.R' will be found,\n",
"this error will not be thrown")
})
}, spaced = TRUE, verbose = FALSE, width.cutoff = 60L)
}, FILE.R)
this.path:::.Rscript(
c("--default-packages=this.path", "--vanilla", FILE.R)
)
unlink(FILE.R)
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)
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.