Package 'script'

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

Help Index


Identify Script Name

Description

Identifies script name in a variety of contexts, e.g. interactively or when script is sourced. Attempts to support RStudio environment.

Usage

script()

Value

character: path to current file, or empty string if indeterminate

Examples

script()

Identify Script base Name

Description

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.

Usage

scriptbase(ext = NULL)

Arguments

ext

replacement extension

Value

character: current filename, or empty string if indeterminate

Examples

scriptbase('.csv')