setwd()
Published Oct 7, 2022
Contribute to Docs
The setwd()
sets the current working directory to the file path specified.
Syntax
setwd(directory)
The setwd()
function returns the current directory before it is changed to the file path of the directory
parameter string.
Example
The following example sets the working directory to the file path “/Users/kyra/Documents/students”:
setwd("/Users/kyra/Documents/students")
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.