setPath: setPath

View source: R/paths.R

setPathR Documentation

setPath

Description

Set a named path to avoid absolute path in R scripts

Usage

setPath(pathname, path, makedir = c("Ask", "Force", "Never"))

Arguments

pathname

pathname Label

path

absolute path to associate with the pathname

makedir

if "Force" path will be created if it doesn't exist, if "Never" path will not be created and a warning will pop if path is missing. If set to "Ask" a prompt will ask for confirmation before creating the missing directory

Value

Previous defined path

Examples

setPath("SOURCES","c:/dev/Rsources", makedir = "Never")
getPath("SOURCES")

# Setting a name/keyword associated to a specific path
setPath(pathname = "DATA", 
        path = "./data", # Note './' for relative paths
        makedir = "Never")
# Checking the path is properly set
getPath("DATA")


Epiconcept-Paris/STRAP-epiuf documentation built on Aug. 5, 2024, 3:41 a.m.