Skip to content

scriptloc

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

v1.0.0 · Aug 17, 2023 · MIT + file LICENSE

Description

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.

Downloads

138

Last 30 days

22471st

138

Last 90 days

138

Last year

CRAN Check Status

14 NOTE
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang NOTE
r-devel-linux-x86_64-debian-gcc NOTE
r-devel-linux-x86_64-fedora-clang NOTE
r-devel-linux-x86_64-fedora-gcc NOTE
r-devel-macos-arm64 NOTE
r-devel-windows-x86_64 NOTE
r-oldrel-macos-arm64 NOTE
r-oldrel-macos-x86_64 NOTE
r-oldrel-windows-x86_64 NOTE
r-patched-linux-x86_64 NOTE
r-release-linux-x86_64 NOTE
r-release-macos-arm64 NOTE
r-release-macos-x86_64 NOTE
r-release-windows-x86_64 NOTE
Check details (14 non-OK)
NOTE r-devel-linux-x86_64-debian-clang

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-devel-linux-x86_64-debian-gcc

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-devel-linux-x86_64-fedora-clang

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-devel-linux-x86_64-fedora-gcc

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-devel-macos-arm64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-devel-windows-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-oldrel-macos-arm64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-oldrel-macos-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-oldrel-windows-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-patched-linux-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-release-linux-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-release-macos-arm64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-release-macos-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-release-windows-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^

Check History

NOTE 0 OK · 14 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 9, 2026
NOTE r-devel-linux-x86_64-debian-clang

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-devel-linux-x86_64-debian-gcc

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-devel-linux-x86_64-fedora-clang

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-devel-linux-x86_64-fedora-gcc

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-devel-macos-arm64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-devel-windows-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-patched-linux-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-release-linux-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-release-macos-arm64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-release-macos-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-release-windows-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-oldrel-macos-arm64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-oldrel-macos-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^
NOTE r-oldrel-windows-x86_64

Rd files

checkRd: (-1) scriptloc.Rd:5: Lost braces; missing escapes or markup?
     5 | \title{Get location of script in a fashion analagous to ${BASH_SOURCE[0]}}
       |                                                          ^

Version History

new 1.0.0 Mar 9, 2026