Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set path in rstudio

Tags:

r

Can anyone please guide me setting up the path in rstudio, why I cant change present working directory. what if I want to save a file on desktop and pull up the file in Rstudio.

Your help is appreciated.

thanks, sandy

like image 884
Sandeep Jangam Avatar asked Sep 11 '25 17:09

Sandeep Jangam


1 Answers

Some of the most common reasons I have found where setting directory was a problem with the solution

  • Forgot the "" marks around the path example of correct setwd("Libraries/Documents")

  • Working in Windows and forgot to switch the back-slash to a forward slash, examples: WRONG-> "Libraries\Documents" RIGHT->"Libraries/Documents"

  • There path is on a shared system where they system denies that access (we have remote folders on servers at work that cannot be addressed this way)...IT security

  • The directory is not actually mapped as you stated, example possibly you do not need the Libraries part or you have to expressly include another level of folders above your current address

  • The directory has a different name, a capital letter, a space in it or something making addressing it on your system difficult

  • You are actually already in the wanted directory. as joel said, try getwd() to see where it says you are.

If none of this is your problem, post the error message and your system (linux, OS10.?, Windows 7 pro) and they setwd("path_to_stuff") you are using and we can try to get to the heart of the matter better.

like image 184
sconfluentus Avatar answered Sep 13 '25 07:09

sconfluentus