scriptloc: Get the Location of the R Script that is Being Sourced/Executed

Provides functions to retrieve the location of R scripts loaded through the source() function or run from the command line using the Rscript command. This functionality is analogous to the Bash shell's ${BASH_SOURCE[0]}. Users can first set the project root's path relative to the script path and then all subsequent paths relative to the root. This system ensures that all paths lead to the same location regardless of where any script is executed/loaded from without resorting to the use of setwd() at the top of the scripts.

Version: 1.0.0
Depends: R (≥ 3.6.0)
Suggests: knitr, rmarkdown, prettydoc
Published: 2023-08-17
Author: Naren Chandran Sakthivel ORCID iD [aut, cre]
Maintainer: Naren Chandran Sakthivel <narenschandran at gmail.com>
License: MIT + file LICENSE
NeedsCompilation: no
Materials: README
CRAN checks: scriptloc results

Documentation:

Reference manual: scriptloc.pdf
Vignettes: Introdution to scriptloc and its usecase

Downloads:

Package source: scriptloc_1.0.0.tar.gz
Windows binaries: r-devel: scriptloc_1.0.0.zip, r-release: scriptloc_1.0.0.zip, r-oldrel: scriptloc_1.0.0.zip
macOS binaries: r-release (arm64): scriptloc_1.0.0.tgz, r-oldrel (arm64): scriptloc_1.0.0.tgz, r-release (x86_64): scriptloc_1.0.0.tgz, r-oldrel (x86_64): scriptloc_1.0.0.tgz

Linking:

Please use the canonical form https://CRAN.R-project.org/package=scriptloc to link to this page.