[R] R_LIBS_USER not in libPaths

Martin Morgan martin.morgan at roswellpark.org
Sat Sep 16 18:03:31 CEST 2017


On 09/16/2017 11:29 AM, Rene J Suarez-Soto wrote:
> 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.

If the directory pointed to by R_LIBS_USER does not exist, then 
.libPaths() will not contain it. This is documented on ?.libPaths or 
?R_LIBS_USER

      Only directories
      which exist at the time will be included.

The file in the user home directory is .Renviron, rather than 
Renviron.site. This documented at, e.g,. ?Renviron

      The name of the user file
      can be specified by the 'R_ENVIRON_USER' environment variable; if
      this is unset, the files searched for are '.Renviron' in the
      current or in the user's home directory (in that order).

R environment variables are set when R starts; I can discover these, on 
linux, by invoking the relevant command-line command after running R CMD

$ env|grep "^R_"
$

(i.e., no output) versus

$ R CMD env|grep "^R_"
R_UNZIPCMD=/usr/bin/unzip
...

Generally, ?Startup describes the startup process, and most variables 
are described in R via ?R_...

Martin

> 
> 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]]
> 
> ______________________________________________
> 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 message may contain legally privileged and/or...{{dropped:2}}



More information about the R-help mailing list