Get & Set Working Directory in R (3 Examples) | getwd & setwd Functions | Change File Path of Folder

preview_player
Показать описание
R code of this video:

getwd() # Apply getwd function

setwd("C:/Users/Joach/Desktop/my_folder") # Apply setwd function

getwd() # Checking new working directory

my_path <- "C:/Users/Joach/Desktop/my_folder" # Save path

Follow me on Social Media:

Рекомендации по теме
Комментарии
Автор

Your video is very helpful thank you so much

TaraGhimite
Автор

I've tried to change the working directory in RStudio from "/cloud/project" to a directory (file ) I first set up on an external hard drive, and then (when that wouldn't work) on my desktop. Neither will work. Any suggestions?

beachlife
Автор

What is the "1:5" that you put in the write.csv2 function?

xxxx
Автор

I have a code which has several file paths or directories being read in and I want to change the same, one subfolder in each path. Instead of manually changing them one by one, I’ve assigned it as a value, say x <- Joach and then in my file path in place of Joach, I have written it as /“, x, ”/ for more automation. This is how I remember it should work however my code isn’t working properly. If you’re familiar with this issue, can you explain what I’m doing wrong?

ruairimccay