[R-SIG-Mac] PATH

Simon Urbanek simon.urbanek at r-project.org
Mon Jan 30 18:16:29 CET 2012


On Jan 30, 2012, at 12:06 PM, Guillaume Meurice wrote:

> Dear all,
> 
> 
> I can't figure out how R.app is getting my environment variable $PATH.
> 

Try R for Mac FAQ 12.19.


> Launching R via a terminal perfectly get my $PATH variable : 
> 
>> Sys.getenv()[["PATH"]]
> [1] "/Users/meurice/Documents/Developement/eclipseWorkSpace/ibp/genomics/utils/bash/:.:/usr/texbin/:/usr/local/texlive/2011/bin/x86_64-darwin:/opt/local/bin:/opt/local/sbin:/Users/meurice/Documents/Application/BioinfoTools/bowtie2-2.0.0-beta3:/Users/meurice/Documents/Developement/eclipseWorkSpace/ibp/genomics/utils/bash/:.:/usr/texbin/:/usr/local/texlive/2011/bin/x86_64-darwin:/opt/local/bin:/opt/local/sbin:/Users/meurice/Documents/Applications/BioinfoTools/bowtie2-2.0.0-beta3:/Users/meurice/Documents/Developement/eclipseWorkSpace/ibp/genomics/utils/bash/:.:/usr/texbin/:/usr/local/texlive/2011/bin/x86_64-darwin:/opt/local/bin:/opt/local/sbin:/Users/meurice/Documents/Tools/bowtie2-2.0.0-beta3:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin"
> 
> 
> But when I'm launching R with R.app (or R studio), the $PATH I get from Sys.getenv() has nothing to do with my current and real $PATH : 
> 
>> Sys.getenv()[["PATH"]]
> [1] "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
> 
> 
> I've managed to set up the $PATH directory through the use of .Renviron, but I would really like R.app to read my $PATH from 
> my .bash_profil, which is not the case.
> 

R.app is not a shell - and neither is R - so they simply use the environment you setup. .bash_* fines are only used by bash, so unless you start bash they have no meaning.

R.app inherits the environment from the launch services which don't read your profile - again, it's not a shell. See Apple's QA in how to change the environments for apps:

http://developer.apple.com/library/mac/#qa/qa1067/_index.html

Cheers,
Simon




> 
> Thanks by advance for any help.
> --
> GM
> 
> 
>> sessionInfo()
> R version 2.14.0 (2011-10-31)
> Platform: i386-apple-darwin9.8.0/i386 (32-bit)
> 
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base     
> 
> other attached packages:
> [1] snowfall_1.84 snow_0.3-8   
> 
> loaded via a namespace (and not attached):
> [1] tools_2.14.0
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 
> 



More information about the R-SIG-Mac mailing list