[R-SIG-Mac] Executing older intalled versions of R

Simon Urbanek simon.urbanek at r-project.org
Sun Apr 6 18:12:23 CEST 2008


Gregory,

On Apr 5, 2008, at 7:45 PM, Gregory Warnes wrote:

> For some automated software building, I need to be able to execute  
> older versions of R via the command line.  Currently, even if I  
> provide the full path to the R shell script, the current version of  
> R gets executed.  For instance,
>
> 	/Library/Frameworks/R.framework/Versions/2.4/Resources/bin/R -- 
> version
> 	R version 2.6.2 (2008-02-08)
> 	Copyright (C) 2008 The R Foundation for Statistical Computing
> 	ISBN 3-900051-07-0
> 	[...]
>
> and
>
> 	[Straight:~] warnes% /Library/Frameworks/R.framework/Versions/2.4/
> Resources/bin/R RHOME
> 	/Library/Frameworks/R.framework/Resources
>
> and
>
> 	[Straight:~] warnes% /Library/Frameworks/R.framework/Versions/2.4/
> Resources/bin/R
> 	
> 	R version 2.6.2 (2008-02-08)
> 	Copyright (C) 2008 The R Foundation for Statistical Computing
> 	ISBN 3-900051-07-0
> 	[...]
>
>
> Is there a particular reason why the R shell script defines
>
> 	R_HOME_DIR=/Library/Frameworks/R.framework/Resources
>
> instead of
>
> 	VERSION=2.4 # or whatever
> 	R_HOME_DIR=/Library/Frameworks/R.framework/Versions/$VERSION$/ 
> Resources
>
> with similar changes through the rest of the file?


Mostly compatibility. A global script would stop working after an  
update if it used hard-coded versions. External tools should make no  
assumptions about the internal versioning scheme. Only embedding  
applications (e.g. the GUI) rely on the versioning scheme and they  
will obtain R_HOME from the linked library so they are not affected  
(ever since the framework has an ID - if you want to use versions  
before the ID introduction, you may have to add one).

Starting R from a different version than the current one is not tested  
or supported, and may not work - in particular older versions won't  
(some versions were explicitly using the "current" version regardless  
of the versioned path).

Clearly, you're free to compile R with a different framework path and  
you're also free to modify the script - it's all up to you - but that  
is not the default setup.

I'm not quite sure why it is an issue in your case - as with all Mac  
OS X frameworks, the established (Apple) way to switch versions is by  
changing the Versions/Current symlink and that is supported.

Cheers,
Simon



More information about the R-SIG-Mac mailing list