How to Update R Using RStudio(For Windows, Mac and Linux)

To update R using RStudio, you can follow these steps:

  1. Install the installr package (Windows only) or use the updateR() function from the rstudioapi package (macOS and Linux).
  2. Run the appropriate function to update R.
  3. Restart RStudio.

Please note that the installr package is available only for Windows. If you’re using macOS or Linux, you must update R manually by downloading the latest version from the R website and installing it.

Using Windows

You can download a new version of R from CRAN. Then restart your RStudio. The new R version will be loaded automatically. The new R version appears right after I install R and restart RStudio.

Another way is following via code.

# Install the 'installr' package if not already installed
if (!requireNamespace("installr", quietly = TRUE)) {

# Load the 'installr' package

# Update R

After running the updateR() function, follow the instructions in the dialog windows.

Once the update is complete, restart RStudio.

Using MacOS and Linux

Unfortunately, there’s no built-in function to update R on macOS or Linux. Instead, you’ll need to manually update R by following these steps:

  1. Go to the Comprehensive R Archive Network (CRAN) website:
  2. Download the latest version of R for your operating system (either macOS or Linux).
  3. Install the downloaded R package following the installation instructions for your operating system.
    Restart RStudio.

After installing the new version and restarting RStudio, you should be running the latest version of R. You can check the current R version by running:


That’s it.

Leave a Comment