thisfile: Determines the path of the currently running script

Description Usage Details Value Author(s) References See Also Examples

View source: R/thisfile.R

Description

R does not store nor export the path of the currently running script. This is an attempt to circumvent this limitation by applying heuristics (such as call stack and argument inspection) that work in many cases.

Usage

1

Details

This function currently works only if the script was sourced or run with Rscript or using the --file parameter to the R executable. For code run with Rscript, the exact value of the parameter passed to Rscript is returned.

Value

The path of the currently running script, NULL if it cannot be determined.

Author(s)

Kirill M<c3><bc>ller, Hadley Wickham, Michael R. Head

References

http://stackoverflow.com/q/1815606/946850

See Also

source, Rscript, getwd

Examples

1
## Not run: thisfile()

kimisc documentation built on May 2, 2019, 6:09 p.m.