local_path: local_path() returns the parent directory of the working...

View source: R/local_path.R

local_pathR Documentation

local_path() returns the parent directory of the working directory.It aids the generation of relative directory to store all code in single folder, and then reproduce the calculations in a Mac OS machine or a Windows machine, or else.

Description

local_path() returns the parent directory of the working directory.It aids the generation of relative directory to store all code in single folder, and then reproduce the calculations in a Mac OS machine or a Windows machine, or else.

Usage

local_path(x)

Arguments

x

a string with directory location (e.g, '/00_data/', '/01_syntax/', '/02_tables/')

Value

an absolute route or logical directory for the current machine, adding its root directory

Examples



parent_directory <- local_path(getwd())
parent_directory #  this is the current working directory
                 #  it assumes the syntax folder, is within the parent directory

dacarras/r4sda documentation built on Nov. 9, 2023, 10:17 a.m.