Appendix G. Updating an R installation
As consumers, we take for granted that we can update a piece of software via a Check for Updates option. In chapter 1, I noted that the update.packages() function can be used to download and install the most recent version of a contributed package. Unfortunately, updating the R installation itself can be more complicated.
If you want to update an R installation from version 5.1.0 to 6.1.1, you must get creative. (As I write this, the current version is actually 3.1.1, but I want this book to appear hip and current for years to come.) Two methods are described here: an automated method using the installr package and a manual method that works on all platforms.
If you’re a Windows user, you can use the installr package to update an R installation. First install the package and load it:
This adds an Update menu to the RGui (see figure G.1).
The menu allows you to install a new version of R, update existing packages, and install other useful software produces (such as RStudio). Currently, the installr package is only available for Windows platforms. For Mac users, or Windows users that don’t want to use installr, updating R is usually a manual process.