Learn R Programming

this.path (version 1.4.0)

try.this.path: Attempt to Determine Executing Script's Filename

Description

try.this.path() attempts to return the normalized path of the executing script, returning the original path of the executing script if that fails, returning NA_character_ if that fails as well.

try.shFILE() attempts to extract and normalized FILE from either of the following: -f FILE or --file=FILE, returning the original FILE if that fails, returning NA_character_ if that fails as well.

Usage

try.this.path(contents = FALSE)
try.shFILE()

Value

character string.

Arguments

contents

TRUE or FALSE; should the contents of the executing script be returned instead, NULL if that fails.

Details

This should NOT be used to construct file paths against the executing script's directory. This should exclusively be used in the scenario that you would like the normalized path of the executing script, perhaps for a diagnostic message, but it is not required to exist and can be a relative path or undefined.

See Also

this.path()

shFILE()

Examples

Run this code
try.shFILE()
try.this.path()
try.this.path(contents = TRUE)

Run the code above in your browser using DataLab