0% found this document useful (0 votes)
95 views

Updating R

The document discusses how to update R and RStudio on different operating systems. It provides instructions for updating R on Windows using the installr package. It notes that on Mac and Ubuntu you need to go to CRAN to install the newer package installer. Updating RStudio is easy by going to Help > Check for Updates. It also discusses how to update R packages using update.packages() and reinstalling all packages after updating R.

Uploaded by

Art
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views

Updating R

The document discusses how to update R and RStudio on different operating systems. It provides instructions for updating R on Windows using the installr package. It notes that on Mac and Ubuntu you need to go to CRAN to install the newer package installer. Updating RStudio is easy by going to Help > Check for Updates. It also discusses how to update R packages using update.packages() and reinstalling all packages after updating R.

Uploaded by

Art
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

4/23/2019 Updating R and RStudio

Updating R and RStudio


Nick Hathaway; [email protected]
(mailto:[email protected])
Updating R
Updating on Windows
Updating On Mac and Ubuntu
Updating RStudio
Updating R Packages
Updating Out of date Packages
Updating all Packages after R update

Updating R
Updating on Windows
Updating on Windows is apparently tricky, a package called installr , which is only for
Windows can be used to ease the process.
The following commands were taken from here (http://www.r-statistics.com/2013/03/updating-
r-from-r-on-windows-using-the-installr-package/), which goes into more details.
First Install the installr package if you don’t have it

# installing/loading the package:


if(!require(installr)) {
install.packages("installr");
require(installr)
} #load / install+load installr

Now call updateR() function to call update


This will start the updating process of your R installation. It will check for newer versions, and if
one is available, will guide you through the decisions you’d need to make.

# using the package:


updateR()

Updating On Mac and Ubuntu


One Mac and Ubuntu you need to go to the CRAN (https://www.r-project.org/) website,
https://www.r-project.org/ (https://www.r-project.org/) to install the newer package intaller.

Updating RStudio
Updating RStudio is easy, just go to Help > Check for Updates to install newer version.

https://bioinfo.umassmed.edu/bootstrappers/bootstrappers-courses/courses/rCourse/Additional_Resources/Updating_R.html 1/2
4/23/2019 Updating R and RStudio

Updating R Packages
Updating Out of date Packages
Updating out of date package that were installed with install.packages() is easy with the
update.packages() function.

update.packages()

Which will ask you for every package if you want to update, to just say yes to everything use
ask = FAlSE .

update.packages(ask = FALSE)

Unfortunately this won’t update packages installed by devtools::install_github()

Updating all Packages after R update


On Windows this is hanlded by the package installr . But for other operating systems, after
updating R, a lot of packages might have been build under the old R version and it would be safer
to re-install all the packages already installed. This can be done with the following commands.
Again this won’t update packages installed with devtools::install_github()

## get packages installed


packs = as.data.frame(installed.packages(.libPaths()[1]), stringsAsFactors = F)

## and now re-install install packages using install.packages()


install.packages(packs$Package)

https://bioinfo.umassmed.edu/bootstrappers/bootstrappers-courses/courses/rCourse/Additional_Resources/Updating_R.html 2/2

You might also like