Title: | Identify Script Name |
---|---|
Description: | Identifies the name of the current script in a variety of contexts, e.g. interactively or when sourced. Attempts to support RStudio environment. Based on <https://stackoverflow.com/a/32016824/2292993> and <https://stackoverflow.com/a/35842176/2292993>. |
Authors: | Tim Bergsma [aut, cre] |
Maintainer: | Tim Bergsma <[email protected]> |
License: | GPL-3 |
Version: | 0.1.3 |
Built: | 2024-11-28 07:04:30 UTC |
Source: | CRAN |
Identifies script name in a variety of contexts, e.g. interactively or when script is sourced. Attempts to support RStudio environment.
script()
script()
character: path to current file, or empty string if indeterminate
script()
script()
Identifies script base name using script
.
if ext
is supplied (and script() is not empty string
),
the last dot (and anything that follows it) is removed if present;
ext
is appended.
scriptbase(ext = NULL)
scriptbase(ext = NULL)
ext |
replacement extension |
character: current filename, or empty string if indeterminate
scriptbase('.csv')
scriptbase('.csv')