In the old version type:
tmp <- installed.packages()
installedpkgs <- as.vector(tmp[is.na(tmp[,"Priority"]), 1])
save(installedpkgs, file="installed_old.rda")Install the most recent version of R:
Download the most recent version of R from The Comprehensive R Archive Network (CRAN)
# To wipe the old R version
rm -rf /Library/Frameworks/R.framework /Applications/R.app
rm -rf /Library/Receipts/R-*Build from source new R version (see this FAQ).
From inside the decompressed R-?.?.? directory type:
# See Section 2.2 of RMacOSX FAQ for the flag description
./configure --with-blas='-framework vecLib' --enable-BLAS-shlib
make
sudo make installInstall BioConductor packages using the biocLite.R installation script.
In an R command window, type the following:
source("http://bioconductor.org/biocLite.R")
chooseBioCmirror()
biocLite()If you have other Bioconductor packages missing from the old installation:
load("installed_old.rda")
tmp <- installed.packages()
installedpkgs.new <- as.vector(tmp[is.na(tmp[,"Priority"]), 1])
missing <- setdiff(installedpkgs, installedpkgs.new)
for (i in 1:length(missing)) biocLite(missing[i])Re-install the missing packages from CRAN:
load("installed_old.rda")
tmp <- installed.packages()
installedpkgs.new <- as.vector(tmp[is.na(tmp[,"Priority"]), 1])
missing <- setdiff(installedpkgs, installedpkgs.new)
install.packages(missing)
update.packages()If you use some package created by Henrik Bengtsson:
source("http://www.braju.com/R/hbLite.R")
hbLite()If you find your X11 broken after the installation procedure (it happens every time to me, at least on Leopard) install the XQuartz App from here.
Update: If you need to install a recent version of R on old hardware (Power PC G4) and OS (Mac OS X 10.4 here) this post can be useful.
Thanks! This is extremely helpful!
RispondiEliminaYou're welcome! :-)
RispondiEliminaGrazie mille, with such good daily tips I'll be back here tommorrow!
RispondiEliminaTroppo gentile! The door is always open! ;-)
RispondiEliminaThanks, very useful indeed.. I also suggest to use chooseBioCmirror() after sourcing "biocLite.R".. depending on your location and the installed packages (Hs map size is around 800Mb) the upgrade running time can be drastically reduced.
RispondiEliminajC
@JC Thanks for your contribution!
RispondiEliminaHi,
RispondiEliminaThanks for the post. When trying to install bioconductor packages using, I get the following error:
>source("http://bioconductor.org/biocLite.R")
Error in file(file, "r", encoding = encoding) :
internet routines cannot be loaded
In addition: Warning message:
In file(file, "r", encoding = encoding) :
unable to load shared object '/Library/Frameworks/R.framework/Resources/modules/x86_64/internet.so':
dlopen(/Library/Frameworks/R.framework/Resources/modules/x86_64/internet.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/2.13/Resources/lib/libR.dylib
Referenced from: /Library/Frameworks/R.framework/Resources/modules/x86_64/internet.so
Reason: Incompatible library version: internet.so requires version 2.13.0 or later, but libR.dylib provides version 2.12.0
Any advice would be appreciated!
It seems (not sure) that some component of the previous version (R.2.12.0) are still in place. I suggest to wipe completely the old version (as stated at the beginning of the post) and try again to install R from scratch. Remember that this procedure works (at least for me) on Mac OS X 10.5. I can't guarantee this will work on Mac OS X 10.6 or 10.7 as well.
RispondiEliminaThank you so much for this. So much easier than copying my entire suite of library files and moving them back into the new R directory...
RispondiEliminaI like the sarcasm. I don' like so much comments suggesting alternative strategies without indicate the context in which you can apply them.
RispondiEliminaThe procedure you suggest works almost certainly between minor revisions: e.g., upgrade from R-2.14.0 to R-2.14.1. Nevertheless try to upgrade 'your way' from let's say R-2.9.0 to R-2.14.1! I think you'll have a surprise! My post is meant to explain an upgrade workflow which works FOR ME with the particular configuration (hardware/software) described. It seems to be useful to other people too and I'm glad for that! If anybody (maybe using his real name, nobody bites on this blog ;-) ) want to post a more general, reliable and fast pipeline I'll be more than happy to update the post.