Error: Cannot change working directory in R Studio


I had initially set it to be setwd(“Users/myname/datascience”)

make sure you have the initial / so it is this:

another method is that under the Files Pane in the lower left of RStudio, there is a “More” button. Clicking “More” you will see an option to “Set as Working Directory.” This will set the current directory to whatever folder you have open in your Files Pane.

Once you click this, it will change the current working directory and print the code to perform this, in the console. This is to inform you of the change, as well as ensure reproducibility. Lastly, at the top of the console, you will find the current working directory displayed in that top line.

You’ll see something like this show up in your console: