Hello, I got some of the R source code and not being able to Run it in RStudio. I get the error: Error in setwd("dir") : cannot change working directory I have gone through forums but nothing seemed relevant to my issue. What bugs me the most is the ("dir") that the error shows, is of those who wrote the source code and not mine(it still sees the directory of their computer, even though, I have changed all the directories). When I write getwd(), it dispalys my "dir". Does anyone have any ideas on what's going on here? Thank you -- Greg Lyukshin [[alternative HTML version deleted]] [[alternative HTML version deleted]]
Did you put the directory in quotes with forward slashes? Please show command used. Sent from my iPhone> On Aug 5, 2017, at 1:10 PM, ? ? <yangliufeng at outlook.com> wrote: > > Hello, I got some of the R source code and not being able to Run it in > RStudio. > I get the error: > > Error in setwd("dir") : > cannot change working directory > > > I have gone through forums but nothing seemed relevant to my issue. > What bugs me the most is the ("dir") that the error shows, is of thosewho> wrote the source code and not mine(it still sees the directory of their > computer, even though, I have changed all the directories). > When I write getwd(), it dispalys my "dir". > Does anyone have any ideas on what's going on here? > Thank you > > > -- > Greg Lyukshin > > [[alternative HTML version deleted]] > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
On 05/08/2017 10:55 AM, ? ? wrote:> Hello, I got some of the R source code and not being able to Run it in > RStudio. > I get the error: > > Error in setwd("dir") : > cannot change working directory > > > I have gone through forums but nothing seemed relevant to my issue. > What bugs me the most is the ("dir") that the error shows, is of those who > wrote the source code and not mine(it still sees the directory of their > computer, even though, I have changed all the directories). > When I write getwd(), it dispalys my "dir". > Does anyone have any ideas on what's going on here?Try sourcing it with "echo=TRUE", so you can see which line is causing the problem. Presumably some part of the code still references a particular directory. If you are loading binary objects (e.g. using load() or readRDS()), they may trigger code to run that may still have a directory coded. But more likely you've just missed fixing something. Duncan Murdoch
Hello, Inline. Em 05-08-2017 15:55, ? ? escreveu:> Hello, I got some of the R source code and not being able to Run itIf you have the source code, why can't you change it and replace that "dir" with yours, as returned by getwd()? Hope this helps, Rui Barradas in> RStudio. > I get the error: > > Error in setwd("dir") : > cannot change working directory > > > I have gone through forums but nothing seemed relevant to my issue. > What bugs me the most is the ("dir") that the error shows, is of those who > wrote the source code and not mine(it still sees the directory of their > computer, even though, I have changed all the directories). > When I write getwd(), it dispalys my "dir". > Does anyone have any ideas on what's going on here? > Thank you > > > -- > Greg Lyukshin > > [[alternative HTML version deleted]] > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >