Jeromy Anglim's Blog: Psychology and Statistics


Wednesday, August 5, 2009

My Procedure for Upgrading R: Windows XP with StatET

R releases upgrades around every 6 months. I run R on Windows XP using the StatET plug-in and Eclipse. This is my current upgrade procedure. I've posted this mainly for my own future reference. But who knows? it might be useful for someone else:



1. Download the new version of R for Windows from my local mirror

2. Install the new version

3. In order to copy over my library of pre-existing packages. I use one of the batch files called 'movedir.bat' from here
I keep 'movedir.bat' in the R directory.
I then have my own batch file, which I call 'runmovedir.bat' with the following code:
cd \Program Files\R
movedir R-2.7.1\library R-2.9.1\library
where I update old and new version numbers to correspond to the current update.

4. I copy across the "Rprofile.site" (located in for example 'Program Files\R\R-2.7.1\etc') from the old version to the new version

5. I update Eclipse so that it refers to the updated version of R:
Go to menu in Eclipse: Run >> Run Configuration
In the dialog box: R Console > R ; Then the R Config Tab >> Configure
I edit the "Location (R_HOME)" to refer to the current version number

6. I update the environment setting on my computer; (I'm not actually sure if this is necessary for how I currently use R, but I figure that it can't hurt)

a. Hold down Windows & Pause/Break
b. Advanced Tab & Environment Variables
c. System Variables: Path: and change the reference from the old version to the new version.

7. I then Update my packages as set out here
This code is entered into R
update.packages(checkBuilt=TRUE, ask=FALSE)

8. I then uninstall the old version of R.

2 comments:

  1. Hi Jeromy,
    I just came by your post through R-bloggers,
    And thought you might be interested in the post I wrote about upgrading R, here:
    http://www.r-statistics.com/2010/04/changing-your-r-upgrading-strategy-and-the-r-code-to-do-it-on-windows/

    Best,
    Tal

    ReplyDelete
  2. Hi Tal,
    Yes. I had a look at your post.
    I'll be sure to check it out in more detail next time I'm upgrading.
    cheers,
    Jeromy

    ReplyDelete