myPath: Returns the absolute path of the script being called

Description Usage Examples

Description

This function returns the path of a script, being run by Rscript. Note that the function does not work in interactive mode. The function can be used to make R scripts portable, and less rigidly dependent on a single filestructure. Might be UNIX specific?

Usage

1

Examples

1
2
3
4
#!/usr/bin/env Rscript 
print(myPath()) 

returns: /the/path/to/the/script.R

Peder2911/Comfy_In_Turns documentation built on May 14, 2019, 7:15 p.m.