How to Apply the getwd() & setwd() Functions in R (2 Examples)
This article shows how to apply the getwd and setwd functions in order to get or set working directories in the R programming language.
Example 1: Getting Currently Used Working Directory Using getwd() Function
getwd() # Applying getwd() function in R # "C:/Users/Data Hacks/My Example Folder" |
getwd() # Applying getwd() function in R # "C:/Users/Data Hacks/My Example Folder"
Example 2: Setting New Working Directory Using setwd() Function
setwd("C:/Users/Data Hacks/My Example Folder") # Applying setwd() function in R |
setwd("C:/Users/Data Hacks/My Example Folder") # Applying setwd() function in R