[Rd] R as OS X Framework

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Nov 30 08:33:38 MET 2003

On Sat, 29 Nov 2003, Simon Urbanek wrote:

> The current R needs R_HOME to be set before using it even in its 
> embedded form. Now this defeats the idea of location independence of 
> the framework. The application doesn't have to care whether the 
> framework is in /Library/Frameworks, ~/Library/Frameworks or any 
> user-defined framework location. Therefore it would be nice to have a 
> tiny function in the R shlib, that would tell me where the shlib lives 
> (either by using system's API to determine its own location, or at 
> least the path used on installation).
> BTW: This is not Mac specific - I was fighting this on Windows (and 
> unix for that matter) as well - it is possible to run an .exe linked to 
> R.dll from anywhere, if R.dll is in the PATH. But then, one has to 
> determine R_HOME somehow (yes, there is the registry, but that's not 
> really safe if more R versions are installed).

How do you do that?  For R's own executables on Windows R_HOME is
determined from where they are loaded from.  You cannot AFAIK determine
from within an executable where the R.dll was linked from.  That's why the
rproxy.dll uses the registry.  I believe you have even less information on 


Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-devel mailing list