How to Update R and Rstudio on Windows

Updated 11/28/2016.

In this post, I provide instructions for updating R and Rstudio on Windows.

Specifically, these instructions are intended to apply to updating R and Rstudio running on a Windows 2012 server instance at Amazon Web Services. I am assuming that the set up and provisioning of this instance are as described in my series of videos AWS Windows Instance Set Up. Such an instance is running Windows 8.

These instructions, however, should work for other Windows set-ups as well. For example, they work on my Windows notebook computer running Windows 7 as well.

The sources of information I used to figure this out are as follows:

Here are the step-by-step instructions:

  1. Shut down R and Rstudio.
  2. It is best to turn off you antivirus software. The update will probably work if you do not, but you may have to re-do things with your antivirus software disabled if it quarantines any files involved in the installation.
  3. Next run the R GUI. Do not run Rstudio. You will probably find a “shortcut” to the R GUI on your desktop. If so, you can click on that. If you do not see a link on your desktop, you will need to find the program.
  4. If you are running the R GUI, it will say RGui in the upper-left corner of the title bar of the outer window:
  • In Windows 8, you can find the program by pressing the Windows key (so the Start Page appears) and then typing “R” (just the R, not the quotes). There should be links to the R GUI among the search results. If you do not see it there, then you can right click on the Start Page and then click All Apps in the bar that appears at the bottom of the screen.
  • In Windows 7, you can find the program by pressing the Start Key and then clicking on “All Programs.” Next look for the “R” folder and a link to the RGui should be in that folder.
  1. Once you have found the R GUI, run it.
  2. As of updating R on 11/28/2016, the command discussed in this step failed and was unnecessary. So go to the next step. However, if you get an error message about not being able to open the URL and about the connection changing from a secured to an unsecured connection, you might try the following command: In the R Console at the > prompt type:


  1. Next type:

if(!require(installr)) { install.packages("installr"); require(installr) }

Note that the require() function returns FALSE if the package is not available. So the above if() statement installs “installr” if it is not already available and it returns TRUE (hidden) when it is installed.

  1. Then type:


Note: On 4/8/2016 when upgrading from R version 3.2.1 to 3.2.4, updateR() failed with an error message that begins with “Error in strsplit(version_with_dots,” and continued with more opaque information. The problem is that the installr package version that you already have installed is too old install the current version of R. The fix is to remove the installr package and reinstall it. You can remove the installr package with the command
Next stop the RGui with the q() command and then restart it (this is one way to unload the old version package installr so that a new version can be installed). Follow the instructions above to re-start the RGui. Then you can begin again at step 7.

  1. You will then need to answer the questions that are a part of the installation process.

I recommend: (1) Not reading the News; (2) Copying the installed packages; (3) updating the installed packages; (4) copying the Rprofile.

  1. Once the update is complete, exit the RGui by using q().
  2. Run Rstudio
  3. Go to the Help menu and the Check for Updates. If an update is available, you will be taken to the Rstudio download page.
  4. If you need the update, download it, and run the installation file. I think this is straightforward so I won’t give more detailed instructions here.
  5. The last thing you need to do is update your already installed R packages. In RStudio, go to the menu Tools and then click on “Check for package updates…” Again this process is straightforward.
  6. Once you are finished with the installation and updates, turn your antivirus software back on!

The above should take care of updating both R and Rstudio. If you run into problems or have other questions, please comment below. Based on the comments, I will correct any errors or ambiguities in the above instructions.

10 thoughts on “How to Update R and Rstudio on Windows

  1. I try the updateR(). still not working though. it said error in file(con,”r”): cannot open the connection. Can someone tell what to do from there?

  2. I can update R packages without admin rights, but it doesn’t seem to work with RStudio. I’m running RGUI version 3.3.1 and RStudio 0.98.1103. I was able to get an IT guy to update RGUI, but we didn’t get to RStudio.

    What is different about packages that they can install and update with admin rights?

    Thanks for the advice! If it wasn’t for R, I’d be using Excel to analyze data.

  3. RStudion packages update did not work. Error message popped up:
    Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) && :
    missing value where TRUE/FALSE needed

    • Same problem here using ” update.packages(ask=’graphics’,checkBuilt=TRUE)” in R 3.4.0 (Windows 10 64bits). Any help?

  4. I am not able to find CVXR (Convex Optimization) package in My RStudio. When I try to update it says that I’ve the latest version. Someone Help out?

Leave a Comment

Time limit is exhausted. Please reload CAPTCHA.