path_neat: Script Path

View source: R/path_neat.R

path_neatR Documentation

Script Path

Description

Gives, in RStudio, the path to the script file in which it is executed.

Usage

path_neat(subdir = "")

Arguments

subdir

String, optional. Subdirectory relative to the script's path.

Value

Script file's path as string. If subdir is given, it is appended to the original path.

Examples


# assuming the given script is at path "C:/script_folder/"
path_neat('') # returns "C:/script_folder/"
path_neat('my_subdir/misc/') # returns "C:/script_folder/my_subdir/misc/"

# Note: the returned string can be used as argument for base::setwd()
# e.g. setwd( path_neat() ) # sets working directory to the script's path


gasparl/neatstats documentation built on Jan. 10, 2023, 6:23 a.m.