
getwd
returns an absolute filepath representing the current
working directory of the R process; setwd(dir)
is used to set
the working directory to dir
.
getwd()
setwd(dir)
list.files
for the contents of a directory. normalizePath
for a ‘canonical’ path name.
(WD <- getwd())
if (!is.null(WD)) setwd(WD)
Run the code above in your browser using DataLab