this_file {optigrab} | R Documentation |
this_file
Description
Name or path to the current file
Usage
this_file(opts = commandArgs(), local = TRUE, full.path = TRUE)
Arguments
opts |
character; vector of arguments. (Default: |
local |
logical; if |
full.path |
logical; Whetther to return the full path to the sourced
file. (Default: |
Details
this_file
returns the name or path of the executing file whehter
the file was invoked from Rscript or in an interactive session.
Further it source
Argument local
controls whether it is the current file (TRUE
)
or the orignal, top-level file.
Value
one-element character vector with the path to the current file;
returns NA
is in an interactive session not in a file.
References
http://stackoverflow.com/questions/1815606/rscript-determine-path-of-the-executing-script
See Also
Examples
this_file()
[Package optigrab version 0.9.2.1 Index]