Spencer Graves
2022-Jun-17 16:17 UTC
[R] Is it possible to set a default working directory for all R consoles?
I use the free version of RStudio, and I routinely work with "Projects". For new projects, I first I create a new project directory in Finder (in a Mac) or Windows Explorer if it does not already exist. Then in RStudio, I do File > "New Project..." > in "Existing Directory". Then when I want to work on an existing project, I can do File > "Recent Projects" in RStudio. Or I can double click on the appropriate *.Rproj file in Finder or Windows Explorer. Hope this helps. Spencer Graves On 6/17/22 10:46 AM, Bill Dunlap wrote:> Is there an environment variable containing that IP address? > > as.list(grep(value=TRUE, "172", Sys.getenv())) # as.list to make > printing nicer > > If you know which variable is causing the problem you may be able to > override it by setting an R-specific one. > > -Bill > > On Fri, Jun 17, 2022 at 8:28 AM IAGO GIN? V?ZQUEZ <iago.gine at sjd.es> wrote: > >> Hi all, >> >> Is there some way to set a default working directory each time R.exe is >> opened? I ask this because Always that I open R 4.2.o in Windows 10 I get >> the next warning messages >> >> Warning message: >> In normalizePath(path.expand(path), winslash, mustWork) : >> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is denied >> Warning message: >> In normalizePath(path.expand(path), winslash, mustWork) : >> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is denied >> Warning message: >> In normalizePath(path.expand(path), winslash, mustWork) : >> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is denied >> Warning message: >> In normalizePath(path.expand(path), winslash, mustWork) : >> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is denied >> >> Even from cmd.exe in a C: location >> >> C:\Users\me>R >> Warning message: >> In normalizePath(path.expand(path), winslash, mustWork) : >> >> >> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access >> is denied >> Warning message: >> In normalizePath(path.expand(path), winslash, mustWork) : >> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is >> denied >> Warning message: >> In normalizePath(path.expand(path), winslash, mustWork) : >> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is >> denied >> Warning message: >> In normalizePath(path.expand(path), winslash, mustWork) : >> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is >> denied >> >> Reading >> https://cran.r-project.org/bin/windows/base/rw-FAQ.html#What-are-HOME-and-working-directories_003f, >> first I cannot apply the suggested solution (I cannot see such "shortcut?s >> properties"), and second, I am not interested just in Rgui, or even >> RStudio, but other terminals running R (like VSCode-radian or >> SublimeText-Terminus) >> >> Thanks in advance. >> >> Best wishes, >> >> Iago >> >> >> >> [[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. >> > > [[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.
Jeff Newmiller
2022-Jun-17 16:46 UTC
[R] Is it possible to set a default working directory for all R consoles?
While a discussion of working directories appears to address the thoughts expressed by OP, this error seems to be affecting R's ability to find a HOME directory from which to retrieve such items as the .Rprofile file and the default user directory. As such, it needs to be solved before worrying about which IDE to use or whether setting a universal working directory is a good idea. I don't know the specific answer, but Bill's suggestion seems promising to me. I did notice that the erroneous path also contained two nested "profile" directories... I have never seen this before, but that doesn't necessarily mean it is wrong... just seems odd. On June 17, 2022 9:17:01 AM PDT, Spencer Graves <spencer.graves at effectivedefense.org> wrote:> I use the free version of RStudio, and I routinely work with "Projects". For new projects, I first I create a new project directory in Finder (in a Mac) or Windows Explorer if it does not already exist. Then in RStudio, I do File > "New Project..." > in "Existing Directory". > > > Then when I want to work on an existing project, I can do File > "Recent Projects" in RStudio. Or I can double click on the appropriate *.Rproj file in Finder or Windows Explorer. > > > Hope this helps. > Spencer Graves > > >On 6/17/22 10:46 AM, Bill Dunlap wrote: >> Is there an environment variable containing that IP address? >> >> as.list(grep(value=TRUE, "172", Sys.getenv())) # as.list to make >> printing nicer >> >> If you know which variable is causing the problem you may be able to >> override it by setting an R-specific one. >> >> -Bill >> >> On Fri, Jun 17, 2022 at 8:28 AM IAGO GIN? V?ZQUEZ <iago.gine at sjd.es> wrote: >> >>> Hi all, >>> >>> Is there some way to set a default working directory each time R.exe is >>> opened? I ask this because Always that I open R 4.2.o in Windows 10 I get >>> the next warning messages >>> >>> Warning message: >>> In normalizePath(path.expand(path), winslash, mustWork) : >>> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is denied >>> Warning message: >>> In normalizePath(path.expand(path), winslash, mustWork) : >>> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is denied >>> Warning message: >>> In normalizePath(path.expand(path), winslash, mustWork) : >>> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is denied >>> Warning message: >>> In normalizePath(path.expand(path), winslash, mustWork) : >>> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is denied >>> >>> Even from cmd.exe in a C: location >>> >>> C:\Users\me>R >>> Warning message: >>> In normalizePath(path.expand(path), winslash, mustWork) : >>> >>> >>> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access >>> is denied >>> Warning message: >>> In normalizePath(path.expand(path), winslash, mustWork) : >>> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is >>> denied >>> Warning message: >>> In normalizePath(path.expand(path), winslash, mustWork) : >>> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is >>> denied >>> Warning message: >>> In normalizePath(path.expand(path), winslash, mustWork) : >>> path[1]="\\172.19.2.44\profiles\profiles\me\Documents": Access is >>> denied >>> >>> Reading >>> https://cran.r-project.org/bin/windows/base/rw-FAQ.html#What-are-HOME-and-working-directories_003f, >>> first I cannot apply the suggested solution (I cannot see such "shortcut?s >>> properties"), and second, I am not interested just in Rgui, or even >>> RStudio, but other terminals running R (like VSCode-radian or >>> SublimeText-Terminus) >>> >>> Thanks in advance. >>> >>> Best wishes, >>> >>> Iago >>> >>> >>> >>> [[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. >>> >> >> [[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. > >______________________________________________ >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.-- Sent from my phone. Please excuse my brevity.