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"

Example 2: Setting New Working Directory Using setwd() Function

setwd("C:/Users/Data Hacks/My Example Folder") # Applying setwd() function in R

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top