script_dir_get {scriptloc}R Documentation

Return directory where the script exists

Description

This is a convenient wrapper to dirname(scriptloc())

Usage

script_dir_get()

Value

Returns either a single string with path to the file being executed, or NULL

Examples

writeLines("library(scriptloc); script_dir <- script_dir_get(); print(script_dir)", "dir-example.R")
source("dir-example.R")
file.remove("dir-example.R")

[Package scriptloc version 1.0.0 Index]