How to upgrade R with our packages installed

If you want to upgrade your installed version of R, the process is somewhat involved, but doable.

These insturctions cover the case that you have statconnDCOM and RExcel and only want to update R, but keep statconnDCOM and RExcel.

You have to be administrator to perform the following necessary steps, and you need to have a working internet connection during the process.

  • Install the latest version of R
  • Copy your installed packages from the old version of R to the new version of R.
  • Start R with the –vanilla command line option
  • Update the packages
  • Run some housekeeping commands

The steps in more detail

Install R by getting the installer file for the latest version of R from your favorite CRAN mirror.

Run the installer, and be careful to do a custom install selecting the SDI interface and allow R to write its registry entry.

Transfer the packages you have installed in addition to the recommended packages.
Just copying the library subdirectory of your old R installation alone is to dangerous, and this is true in general, not only in relation to our packages.
There are two problems:
you might overwrite the recommended libraries which are part of the R installation itself by older versions,
and you might install older version of packages with the new version of R which might make them unusable.
The batchfiles collection available on CRAN in section Other has a batch file copydir. This file allows you to copy packages from your old R installation to the new one without overwriting already installed packages like the recommended packages.
A typical use of this file (from the command line) is

copydir "c:\Program Files\R\R-3.0.1\library" "c:\Program Files\R\R-3.0.2\library"

Start the new version of R with the vanilla command line option, similar to

"C:\Program files\R\R-3.0.2\bin\Rgui.exe" --vanilla

In the R process you just started, execute

update.packages(checkBuilt=TRUE, ask=FALSE)

Since the mechanism of starting R from within RExcel has changed recently, you should reinstall RExcel with the installer as described in section How to install.

Personal Tools