Hi, I've been trying to set my working directory to a folder on my desktop but I keep getting error messages, I've checked for spellings too. here is my code setwd ("C:/Users/pc/Desktop/divvyTrips")
R returns this;
Error in setwd("C:/Users/pc/Desktop/divvyTrips") : cannot change working directory
You are posting on the Posit Cloud category so if you are actually using that service you have to realize that the RStudio session runs on a server in the cloud and it doesn't have access to your local files so you can't set the working directory to a folder in your desktop.
You are using Posit Cloud indeed, so as I said, you can't set your working directory to a folder on your computer because the program is running on a server in the cloud not in your local system and it doesn't have direct access to your local files.
The way to work on Posit Cloud is to upload the files you need to the server (with the "upload" button on the "Files" panel), so, you don't need to change the working directory.
hello andresrcs, thanks for responding. Does that mean I can only set working directory to a folder on my desktop when Im using the desktop version of R? Ive just started learning r for data analytics. Thanks.
Yes, because a program running on a server on a different part of the world shouldn't have direct access to the files in your computer for security reasons. That is why you have to manually upload the files you need to the server.
alright. Thanks. but how come there are tutorials out there teaching how to set working directory to a folder on your desktop, and the interface being shown isnt the desktop version of r? its the posit cloud interface... or im mistaking
Have in mind that you can also run RStudio Server on your own machine and in that specific case you obviously have access to the local files because they are in the server itself.
Also, be aware that manually setting your working directory is an outdated practice, it is better to use a "project oriented" workflow, you can read more about that here:
alright. understood. I was actually trying to upload my files to the files panel but it was taking forever to upload so i just thought id set wd to desktop like i see in all these r tutorials
Thanks for coming through, i didnt even think id get a reply. ill go back to manually uploading them then