tl;dr
If you are running R on Windows you can easily upgrade to the latest version of R using the installr package. Simply run the following code:
# installing/loading the latest installr package:
install.packages("installr"); library(installr) # install+load installr
updateR() # updating R.
Running “updateR()” will detect if there is a new R version available, and if so it will download+install it (etc.). just press “next”, “OK”, and “Yes” on everything…
A GUI interface to updating R on Windows
Starting from installr version 0.15.0, the upgradingprocess can be done with a click-on-menus GUI interface. Here is how to use it.
Step 1: load installr
# installing/loading the latest installr package:
install.packages("installr") # install installr
library(installr) #load
Step 2: pick “update R” from the new “installr” menu
Step 3: installr will check and detect that there is a new version of R for you – click “OK”
Step 4: if you wish to check the NEWS of the new R version – click “Yes” and a browser window will open up with this information
Step 5: if you want to download and install the latest R version, press “Yes”
Step 6: wait for R to download
Step 7: press “next” in R’s installation wizard
Step 8: wait R finishes to get installed
Step 9: Press “Yes” to copy your packages to the new R installation (press No, if you intend to use the “global R library folder” strategy)
Step 10: to keep package in your old R folder, press “Yes” (this is safest)
Step 11: wait while the packages get copied
Step 12: you can also have Rprofile.site be copied automatically to the new location
Step 13: you may press “Yes” to get update packages in the new R installation
Step 14: if you have a firewall, R may ask to get access to the internet
Step 15: while the packages are updated, you will need to wait. A hidden Rscript process will run in the background and update the packages
Step 16: once it is all done, you will be offered to quit R (sure, why not)
That’s it.
Feedback
I try to keep the installr package updated and useful, so if you have any suggestions or remarks on the package – you are invited to leave a comment below, or report an issue on github.
Thank you. This package is a great help.
In my experience:
In Windows 10 the packages copied from the old R are not allowed by Microsoft to be pasted into the new R.
The subdir library in the new R is not writable and remains so during updating using the R-scripts.
Therefore, the packages in the old R should be copied/pasted by the administrator self, carefully not overwriting existing new packages in the new R.
All packages to be updated by R-script from within the new R can be downloaded in a C://?win-library and from there firstly unzipped and then copied/pasted by the administrator self into the new R library subdir
I wonder if it works better using the installr menu in the Rgui R Console
How do I do this?
You’re right, the packages from the former version of R are not copied.
excellent, a neat way to explain
Hi,
I have used installr for update 3.3.0 to 3.3.1 in Windows 10. It works fine.
Thank you!
I’m glad it helped 🙂
With regards,
Tal
I followed these instructions got 3.4 installed, ran into an error with Rstudio and plotting. Backed up to 3.3.1 and now I cannot install packages from bioclite because I have lost write privileges. Essentially I am crippled and cannot continue to work. Do I uninstall all of R/Rstudio and start over? Any suggestions on how to recover would be appreciated.
Thank you.
This was super helpful.
It’s all updated
I am happy it has really helped
With regards
Robert
precise and very helpful.
many thanks
thank you very much for this. Very straightforward. No issues at all. I think the initial problems I had the previous times I tried doing this had to do with my Internet connection
Hi,
I installed and loaded the package but when I tried it and I got this error:
updateR(install_R = TRUE)
Errore in file(con, “r”) : non posso aprire questa connessione
Error is in italian as I had a version in italian. It translates roughly to “Error in file(with, “r”): can’t open this connection”
Any idea what it could be? (I’m on Windows 7, R version 3.0.2)
Thanks!
Marta
I’ve the same problem 🙁
(Windows 7, R-3.2.2)
Still a helpful article in 2019. Literally so useful and so straightforward. Saves a ton of work when updating R.
Thanks 🙂
Sorry, but I already failed the first step…
“load installr”. Load installr where? And How? I am really at a loss on how to do this…
Hi Tal,
Thanks for this package. What would be nice is an option to update to a specific version of R, not the latest. For example, I would like to update to from version 4.2.1 to version 4.2.3 not 4.3.
Thanks.