cd: Change Directory

View source: R/cd.R

cdR Documentation

Change Directory

Description

Performs relative changes of the working directory. Calling cd("..") moves one level up in the hierarchy whereas cd("folder_name") moves one level down to the designated folder.

Usage

cd(x)

Arguments

x

: A character string corresponding to target directory or "..".

Details

cd is designed as an equivalent to the DOS command. Contrary to the common use of cd, however, this function does not take absolute paths as input. Use setwd instead to navigate to an absulte path.

Value

cd(x) returns the new working directory.

Author(s)

Roland Pfister, Markus Janczyk

See Also

getwd; setwd;

Examples

## Create temporary folder
dir.create("a_test_dir")

## Navigate into the new folder...
cd("a_test_dir")
## ... and back again
cd("..")

## Remove temporary folder
unlink("a_test_dir",recursive=TRUE)

schoRsch documentation built on Nov. 2, 2022, 1:06 a.m.

Related to cd in schoRsch...