Skip to content

How to move existing packages?

6 messages · Petar Milin, Federico Calboli, Simon Urbanek +3 more

#
Hello!
I am new to Mac and I wonder is there a way to migrate all existing packages to the latest R 3.0? I did that for my colleague who uses MS Win, and that never was as issue in Linux. So, what are our options under Mac OS X?

Many thanks,
PM
#
My understanding is that you have to reinstall them from 0.  Having said that, because of dependencies this is often quite trivial if you install some 'high dependencies' packages first.

BW

F
On 9 Apr 2013, at 17:28, Petar Milin <pmilin at gmail.com> wrote:

            
#
On Apr 9, 2013, at 12:28 PM, Petar Milin wrote:

            
You can either use the GUI (in the Package Installer -> "Select Packages from R 2.15" -> Install) or the command line:

a=rownames(installed.packages("/Library/Frameworks/R.framework/Versions/2.15/Resources/library"))
install.packages(!(a %in% rownames(installed.packages())))

The latter works on any OS.

Cheers,
Simon
#
For me !(a %in% rownames(installed.packages())) gives a vector of {TRUE,
FALSE}; so, Simon's second approach didn't work. But the following
(mostly) works:

a <- 
rownames(installed.packages("/Library/Frameworks/R.framework/Versions/2.15/
Resources/library"))
to.install <- setdiff(a, rownames(installed.packages()))
install.packages(to.install)


This didn't work for lme4. So, after installing gfortran-4.2.3.pkg from
<http://cran.r-project.org/bin/macosx/tools/gfortran-4.2.3.pkg> (I already
had all the other needed tools under R 2.15, I guess), I ran the following:

to.install <- setdiff(a, rownames(installed.packages())) # Now just "lme4"
install.packages(to.install, type="source")
On 4/9/13 12:41 PM, "Simon Urbanek" <simon.urbanek at r-project.org> wrote:

            
#
For me !(a %in% rownames(installed.packages())) gives a vector of {TRUE,
FALSE}; so, Simon's second approach didn't work. But the following
(mostly) works:

a <- 
rownames(installed.packages("/Library/Frameworks/R.framework/Versions/2.15/
Resources/library"))
to.install <- setdiff(a, rownames(installed.packages()))
install.packages(to.install)


This didn't work for lme4. So, after installing gfortran-4.2.3.pkg from
<http://cran.r-project.org/bin/macosx/tools/gfortran-4.2.3.pkg> (I already
had all the other needed tools under R 2.15, I guess), I ran the following:

to.install <- setdiff(a, rownames(installed.packages())) # Now just "lme4"
install.packages(to.install, type="source")
On 4/9/13 12:41 PM, "Simon Urbanek" <simon.urbanek at r-project.org> wrote: