Sandeep Jangam
Sandeep Jangam

Reputation: 49

set path in rstudio

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

Upvotes: 4

Views: 21452

Answers (1)

sconfluentus
sconfluentus

Reputation: 4993

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.

Upvotes: 2

Related Questions