getwd {base} | R Documentation |
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
.
getwd()
setwd(dir)
dir |
A character string. |
getwd
returns a character vector, or NULL
if the
working directory is not available.
setwd
returns the current directory before the change,
invisibly. It will give an error if it does not succeed.
These functions are not implemented on all platforms.
list.files
for the contents of a directory.
(WD <- getwd())
if (!is.null(WD)) setwd(WD)