Why can't I change the working directory in RStudio?

2.4k Views Asked by At

I got some example codes from a course that start with

install.packages('maps')
install.packages('geosphere')
library(maps)
library(geosphere)
setwd("C:\\mydata")
...

Everything was fine until the command of setting working directory. Because I installed RStudio and R in D drive, I have also tried "C://", "C:/", "C:\", "D:\", "D:\", "D://", and "D:/". However, the console kept saying "Error in setwd( ): cannot change working directory".

This is probably a studpid question. But I'm a beginner in R, so could somebody be so kind to help me out? Thank you very much!

0

There are 0 best solutions below