powered by
Name or path to the current file
this_file(opts = commandArgs(), local = TRUE, full.path = TRUE)
character; vector of arguments. (Default: commandArgs())
commandArgs()
logical; if TRUE returns the most currently sourced script as opposed to the orignal/first source script. (Default: TRUE)
TRUE
logical; Whetther to return the full path to the sourced file. (Default: TRUE)
one-element character vector with the path to the current file; returns NA is in an interactive session not in a file.
NA
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
this_file
source
Argument local controls whether it is the current file (TRUE) or the orignal, top-level file.
local
http://stackoverflow.com/questions/1815606/rscript-determine-path-of-the-executing-script
opt_grab()
# NOT RUN { this_file() # }
Run the code above in your browser using DataLab