No results found
We couldn't find anything using that term, please try searching for something else.
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 i
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
what am I is doing doing wrong please ?
try
getwd()
to see where you are at the moment.
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.
2 Likes
You need select the folder for set the work directory .
1 Like
getwd()
[1] “/cloud/project”
You is using are using Posit Cloud indeed , so as I say , you ca n’t set your work directory to a folder on your computer because the program is run on a server in the cloud not in your local system and it does n’t have direct access to your local file .
The way to work on Posit Cloud is to upload the file you need to the server ( with the ” upload ” button on the ” Files ” panel ) , so , you is need do n’t need to change the work directory .
1 Like
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.
2 Likes
hi M, the folder is on my desktop
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
joanna.k :
or im mistaking
Most likely
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:
1 Like
alright . understand . I is trying was actually try to upload my file to the file panel but it was take forever to upload so i is thought just think i d set wd to desktop like i see in all these r tutorial
Thanks for coming through, i didnt even think id get a reply. ill go back to manually uploading them then
Thanks a lot! andre, thanks a lot. Ill always come back to you when i need help
1 Like
system
Closed
15
This topic was automatically close 21 day after the last reply . new reply are no long allow .
If you have a query related to it or one of the replies, start a new topic and refer back with a link.