How to Update R: 2 Quick & Easy Methods for Windows & Mac (2024)

  • Categories
  • Computers and Electronics
  • Software
  • Programming

Download Article

Learn how to update R on your Windows or Mac computer

Co-authored byHannah DillonReviewed byLuigi Oppido

Last Updated: March 26, 2024Fact Checked

Download Article

  • Automatic Update with RStudio
  • |
  • Manual Update

Are you trying to update R easily? There are two ways to update R: via RStudio or manually. R is a coding language primarily for data visualization and statistical computing used in a wide variety of fields (such as data analysis). Thankfully, both methods of updating R are quick and easy. In this wikiHow, we'll teach you how to do both.

How to Get the Latest R Update

You can update R easily within RStudio thanks to a package called "installr" (for Windows) or "updateR" (for Mac). If you prefer to update manually, you can easily download the latest R version from CRAN's website and install it on your computer.

Method 1

Method 1 of 2:

Automatic Update with RStudio

Download Article

  1. 1

    Open RStudio. On Windows, you can update R directly in RStudio with the "installr" package. MacOS doesn't have "installr," but you can use a similar package called "updateR" to update R instead.[1]

  2. 2

    Run the installr or updateR command. Run the following command in RStudio to begin the update:

    Advertisem*nt

  3. 3

    Allow the command to install the latest version of R. The "installr" or "updateR" package will check for a new version of R, download it, and install it for you.

  4. 4

    Decide if you want to move your packages. After installing the new version of R, "installr" or "updateR" will ask if you want to move your packages to the new R library.

    • Follow the on-screen instructions to move your packages, if you decide to.
  5. 5

    Decide if you want to update your packages. After moving your packages, "installr" or "updateR" will offer to update your packages.

    • Follow the on-screen instructions to update your packages, if you decide to.
  6. 6

    Open the new Rgui and quit the old R. "Installr" or "updateR" will complete these tasks for you manually. Once you've quit the old R, your system will be updated to the latest version.

  7. Advertisem*nt

Method 2

Method 2 of 2:

Manual Update

Download Article

  1. 1

    Go to the CRAN website for your operating system. You can manually download the latest version of R and install it on your computer, if you prefer. While you will have to move and install your R packages manually, this method gives you more control over the update process.

  2. 2

    Download and run the installer for the latest version of R. The installer will walk you through the process. If you have RStudio open, make sure to close it.

  3. 3

    Open RStudio once the new version of R is installed. RStudio will detect that a new version of R has been installed.

    • To check what version of R your RStudio is using, run the command R.version.string. If the new version of R is shown, you can move on. Otherwise, do the following:
      • Click Tools > Global Options > General > R version > Change.
      • Select the new version of R.
      • Click OK to close the "R Version Chooser" window.
      • Click Apply and then OK to close the "Global Options" window.
  4. 4

    Move your packages to the new R library. Go to your old R library, copy all of your package folders, and move them to the new R library. Your R libraries are found in the following locations by default:

    • Windows: C:\Users\[your username]\Documents\R\win-library\[x.xx]
    • macOS: /Library/Frameworks/R.framework/Versions/[x.xx]/Resources/Library
      • In the filepath, [x.xx] refers to the R version. You should go to the folder for the old version first, copy your packages, and then go to the folder for the new version to paste them.
  5. 5

    Update your packages in RStudio. In RStudio, run the following command to update your packages. When prompted, press y for every question to update the packages.

    update.packages(checkBuilt = TRUE)

  6. 6

    Verify the version of your R install and packages. To make sure everything is updated properly, run the following command in RStudio. If your R version and package versions are displaying as the newest version, you've successfully updated R. If not, go back and repeat the steps in this article carefully.

    version
    packageStatus()

  7. Advertisem*nt

Expert Q&A

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

      Advertisem*nt

      Submit a Tip

      All tip submissions are carefully reviewed before being published

      Submit

      Thanks for submitting a tip for review!

      You Might Also Like

      How to Change 4-Digit User Codes on Schlage Locks2 Simple Ways to Format Text Into Code on Discord
      How toRun a Program from the Command Line on LinuxLearn to Write Pseudocode: What It Is and Why You Need ItHow toMake an Exe File3 Ways to Download GitHub Directories and RepositoriesHow toCodeHow toMake a Program Using NotepadHow to View Source CodeConvert from Decimal to Hexadecimal: A Quick Guide + ExamplesHow toStart XAMPP at Startup in Windows

      Advertisem*nt

      About This Article

      How to Update R: 2 Quick & Easy Methods for Windows & Mac (31)

      Reviewed by:

      Luigi Oppido

      Computer & Tech Specialist

      This article was reviewed by Luigi Oppido and by wikiHow staff writer, Hannah Dillon. Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years. This article has been viewed 6,210 times.

      How helpful is this?

      Co-authors: 2

      Updated: March 26, 2024

      Views:6,210

      Categories: Programming

      • Print
      • Send fan mail to authors

      Thanks to all authors for creating a page that has been read 6,210 times.

      Is this article up to date?

      Advertisem*nt

      How to Update R: 2 Quick & Easy Methods for Windows & Mac (2024)
      Top Articles
      Latest Posts
      Article information

      Author: Prof. Nancy Dach

      Last Updated:

      Views: 5518

      Rating: 4.7 / 5 (57 voted)

      Reviews: 88% of readers found this page helpful

      Author information

      Name: Prof. Nancy Dach

      Birthday: 1993-08-23

      Address: 569 Waelchi Ports, South Blainebury, LA 11589

      Phone: +9958996486049

      Job: Sales Manager

      Hobby: Web surfing, Scuba diving, Mountaineering, Writing, Sailing, Dance, Blacksmithing

      Introduction: My name is Prof. Nancy Dach, I am a lively, joyous, courageous, lovely, tender, charming, open person who loves writing and wants to share my knowledge and understanding with you.