I have a computer where R_LIBS_USER is not found in libPaths. This is for Windows (x64). I ran R from the command line, RGui and RStudio and I get the same results. I also ran R --vanilla and I still get the discrepancy. The only thing I found interesting was that I also ran SET from the command line and the "R related variables" (e.g., R_HOME; R_LIBS_USER) are not there. Therefore these variables are being set when I start R. I have not been able to track where does R obtain the value for these. Aside from looking at http://stat.ethz.ch/R-manual/R-patched/library/base/html/Startup.html I am not sure I have much more information that I have found useful. Thanks R [[alternative HTML version deleted]]

I'm not sure I follow what.the problem is. Are you trying to set R_LIBS_USER but R does not acknowledge it, or do you observe something in R that you didn't expect to be there and you are trying to figure out why that is / where that happens? Henrik On Sep 16, 2017 07:10, "Rene J Suarez-Soto" <rene.j.suarez at gmail.com> wrote:> I have a computer where R_LIBS_USER is not found in libPaths. This is for > Windows (x64). I ran R from the command line, RGui and RStudio and I get > the same results. I also ran R --vanilla and I still get the discrepancy. > > The only thing I found interesting was that I also ran SET from the command > line and the "R related variables" (e.g., R_HOME; R_LIBS_USER) are not > there. Therefore these variables are being set when I start R. I have not > been able to track where does R obtain the value for these. > > Aside from looking at > http://stat.ethz.ch/R-manual/R-patched/library/base/html/Startup.html I am > not sure I have much more information that I have found useful. > > Thanks > > R > > [[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]]

I have not intentionally set R_LIBS_USER. I looked for an Renviron.site file but did not see it in R/etc or my home directory. The strange part is that if I print Sud.getenv I see a value for R_LIBS_USER. However, this directory is not showing under libPaths. I though .libPaths should contain R_LIBS_USER. I also noticed that R related variables are not in the system or user variables because I dont see them when I type SET from the Windows Command line. So a related question is where does R get the system variables (e.g., R_LIBS_USER, R_HOME) if I dont see a Renviron.site file. Thanks On Sep 16, 2017 10:45 AM, "Henrik Bengtsson" <henrik.bengtsson at gmail.com> wrote: I'm not sure I follow what.the problem is. Are you trying to set R_LIBS_USER but R does not acknowledge it, or do you observe something in R that you didn't expect to be there and you are trying to figure out why that is / where that happens? Henrik On Sep 16, 2017 07:10, "Rene J Suarez-Soto" <rene.j.suarez at gmail.com> wrote:> I have a computer where R_LIBS_USER is not found in libPaths. This is for > Windows (x64). I ran R from the command line, RGui and RStudio and I get > the same results. I also ran R --vanilla and I still get the discrepancy. > > The only thing I found interesting was that I also ran SET from the command > line and the "R related variables" (e.g., R_HOME; R_LIBS_USER) are not > there. Therefore these variables are being set when I start R. I have not > been able to track where does R obtain the value for these. > > Aside from looking at > http://stat.ethz.ch/R-manual/R-patched/library/base/html/Startup.html I am > not sure I have much more information that I have found useful. > > Thanks > > R > > [[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/posti > ng-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]

Dear Rene I am not sure I understand your problem so this may be completely uselss but when I am going to run R from the command line I first of all run a little batch file. set R_HOME=C:\Users\Michael\Documents\bin\R\R-3.4.1 set R_PATH=%R_HOME%\bin\x64 set PATH=%R_PATH%;%PATH% Someone (forgotten who, sorry) posted this years ago on this site. Michael On 16/09/2017 14:16, Rene J Suarez-Soto wrote:> I have a computer where R_LIBS_USER is not found in libPaths. This is for > Windows (x64). I ran R from the command line, RGui and RStudio and I get > the same results. I also ran R --vanilla and I still get the discrepancy. > > The only thing I found interesting was that I also ran SET from the command > line and the "R related variables" (e.g., R_HOME; R_LIBS_USER) are not > there. Therefore these variables are being set when I start R. I have not > been able to track where does R obtain the value for these. > > Aside from looking at > http://stat.ethz.ch/R-manual/R-patched/library/base/html/Startup.html I am > not sure I have much more information that I have found useful. > > Thanks > > R > > [[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. > > --- > This email has been checked for viruses by AVG. > http://www.avg.com > >-- Michael http://www.dewey.myzen.co.uk/home.html

These environment variables are _inputs_ to the R startup sequence, and optional ones at that. If you don't set them then R makes default settings. Read the R Installation and Administration manual that comes with R for more information. You also need to understand the scope of environment variables, which is a topic specific to each operating system and is not specific to R. In a nutshell, a process (running program) that sets an environment variable can pass that setting to processes it starts, but the reverse is not true. If you want to set such variables for widespread use you can use the System control panel and logout and login so all processes will inherit them. Note that if you want to modify .libpaths in R you can do so without modifying environment variables. -- Sent from my phone. Please excuse my brevity. On September 16, 2017 6:16:05 AM PDT, Rene J Suarez-Soto <rene.j.suarez at gmail.com> wrote:>I have a computer where R_LIBS_USER is not found in libPaths. This is >for >Windows (x64). I ran R from the command line, RGui and RStudio and I >get >the same results. I also ran R --vanilla and I still get the >discrepancy. > >The only thing I found interesting was that I also ran SET from the >command >line and the "R related variables" (e.g., R_HOME; R_LIBS_USER) are not >there. Therefore these variables are being set when I start R. I have >not >been able to track where does R obtain the value for these. > >Aside from looking at >http://stat.ethz.ch/R-manual/R-patched/library/base/html/Startup.html I >am >not sure I have much more information that I have found useful. > >Thanks > >R > > [[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.