scriptloc
Get the Location of the R Script that is Being Sourced/Executed
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
199
Last 30 days
22483rd
531
Last 90 days
2K
Last year
Trend: +21.3% (30d vs prior 30d)
CRAN Check Status
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)
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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 10, 2026
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^
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]}}
| ^