this.dir: this.dir

Description Usage Arguments Examples

View source: R/setup.r

Description

Change the current directory (for RStudio).

Usage

1
this.dir(chdir=<BOOL>);

Arguments

chdir

boolean. Default chdir=TRUE. Whether or not to change directory to location of current script, or simply return the path.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# Prefix script with:
bool <- this.dir();
# or
bool <- this.dir(chdir=TRUE);
# to change to current directory.
# Return value: bool = TRUE <==> succesfully found currently and changed to this path.

path <- this.dir(chdir=TRUE);
# does not change directory, but attempts to get
# the folder location of current script.
# If unsuccessful, returns path = NULL.

## End(Not run)

RLogik/rbettersyntax documentation built on Aug. 1, 2020, 10:44 p.m.