this_file: this_file

Description Usage Arguments Details Value References See Also Examples

View source: R/this_file.R

Description

Name or path to the current file

Usage

1
this_file(opts = commandArgs(), local = TRUE, full.path = TRUE)

Arguments

opts

character; vector of arguments. (Default: commandArgs())

local

logical; if TRUE returns the most currently sourced script as opposed to the orignal/first source script. (Default: TRUE)

full.path

logical; Whetther to return the full path to the sourced file. (Default: TRUE)

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

1

decisionpatterns/optigrab documentation built on Jan. 8, 2019, 3:28 a.m.