R: Get or Set Working Directory

getwd {base} | R Documentation

## Get or Set Working Directory

### Description

`getwd` returns an absolute filename representing the current working directory of the R process; `setwd(dir)` is used to set the working directory to `dir`.

### Usage

    getwd()
    setwd(dir)

### Arguments

`dir` | A character string.

### Examples

    (WD <- getwd())
    if (!is.null(WD)) setwd(WD)

[Package Contents]