Oct 4, 2016

How to Upgrade R version in Windows. The easy way recommended on CRAN

Today I have found myself needing to upgrade R. Main reason was that my current version  R-3.2.1 did not support some new graphic packages. To install these new packages I needed at least a R-3.3 version.

After a bit of initial hesitation (will I lose my packages during the new installation? etc. etc.) I finally took some courage and decided to follow the official documentation on CRAN. Everything worked just fine and I have now installed the latest available R version on CRAN: at the time I write this post it´s R-3.3.1.

The upgrading process was really easy, so I thought to share it step by step. Enjoy :)


1. Check your current R version

To find out your current version, open R and it will be shown in the console. If you are using RStudio you can check you R version by clicking on Tools>Global Options... yep my current version is now R-3.3.1.

Find your R version

2. Locate your current R folder 

If you did not change the default path in your previous installation, you should be able to find the main R folder under C:\Program Files\R.

Make sure to locate your library folder too (the one containing all the packages you installed so far). It can be that either:
  1. all of your packages (the ones you have installed yourself plus the ones coming by default with the R version you originally installed) are in the library folder, under the main R folder (e.g. "C:\Program Files\R\R-3.1")
  2. or, like in my case, the packages I have manually installed are in a different folder. In my previous version they were located under this path: C:\Users\Marco\Documents\R\win-library\3.1

3. Download the latest version from CRAN

Go to CRAN website here and download the latest R version for Windows. At the day I am writing this post it's R-3.3.1.

Download R-3.3.1 Windows

4. Uninstall your current R version 

As you uninstall any other program in your Windows machine, go to Control Panel>Applications and uninstall your current R version.

5. Install the latest version on your machine

I suggest to leave the default path which should be "C:\Program Files\".

6. Copy your old packages on your new R folder

With the newer version only basic R packages will be installed. To avoid you installing again all your previous packages, go to your old library folder as per step 2 and copy your packages. Then paste them into your new library folder.

7. Make sure your packages are updated

To make sure your packages are updated to the latest version available on CRAN, you can run the following command from the R console: update.packages(checkBuilt=TRUE, ask=FALSE).


13 comments:

  1. Thank you for this post. I first installed R on my system over a year ago. I used it for one class, but went a while without using it after that. Now I am using more extensively for another class. I finally got tired of the warning messages that a package was built for ver 3.4.4 (I had 3.4.3)
    I followed your steps and everything went smoothly with my update from 3.4.3 to 3.5.3

    ReplyDelete
  2. fantastic points altogether, you just gained a new reader. What would you suggest about your post that you made a few days ago? Any positive?digital marketing strategy

    ReplyDelete
  3. very informative blog and useful article thank you for sharing with us , keep posting
    Data Science online Training

    ReplyDelete
  4. Do you mind if I quote a few of your articles as long as I provide credit and sources back to your site? My blog is in the exact same area of interest as yours and my visitors would truly benefit from some of the information you present here. Please let me know if this ok with you. Regards!
    ensure website design firm has right SOP

    ReplyDelete
  5. Nice blog here! Also your web site loads up fast! What host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as fast as yours lol
    online advertising companies singapore

    ReplyDelete
  6. Hi there! Do you know if they make any plugins to protect against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any recommendations?
    seo sg

    ReplyDelete

  7. I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.
    WordPress website development Chennai

    ReplyDelete
  8. Thanks for your post. seems to be useful for me.

    ReplyDelete
  9. Among the Benefits of Experiential Marketing, the foremost would be to provide the consumer with real-like experience and meaningful interaction with the brand. It would help the business enhance their business along with gaining success in the business arena.

    ReplyDelete
  10. This is very interesting, You're a very skilled blogger. I've joined your feed and look forward to seeking more of your magnificent post. Also, I've shared your website in my social networks! wedding tentage rental singapore

    ReplyDelete
  11. Heya just wanted to give you a brief heads up and let you know a few of the images aren't loading properly. I'm not sure why but I think its a linking issue. I've tried it in two different internet browsers and both show the same outcome. dental specialist singapore

    ReplyDelete
  12. Hi there this is kind of of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I'm starting a blog soon but have no coding know-how so I wanted to get guidance from someone with experience. Any help would be greatly appreciated! architecture firms in Singapore

    ReplyDelete