PDF download Download Article
Try one of these methods to update rlang quickly & easily
PDF download Download Article

Are you trying to update your rlang package in RStudio or the R Console? This package is notoriously finicky to update, so if you're struggling to update it, you're not alone! In this article, we'll go over how to update rlang with a command, as well as in the RStudio GUI. We have included some troubleshooting tips for the most common issues when updating rlang.

Quick Steps to Update Your Rlang Package

  1. Clear your R environment with rm(list = ls ()) .
  2. Restart RStudio or R Console, making sure not to load any packages once it restarts.
  3. Run the command install.packages("rlang") to update rlang.
Section 1 of 3:

Updating Rlang With a Command

PDF download Download Article
  1. You can do this in both RStudio or the R Console, whichever you prefer working with. Run the following command to clear your R environment:

    rm(list = ls ())

  2. The reason you want to clear your R environment and restart RStudio or the R Console is to ensure no other packages load that use rlang. This will cause issues when trying to update the package.
    • In RStudio, you can alternatively press Ctrl+Shift+F10 to clear your global environment and restart the application.
    Advertisement
  3. When you restart RStudio or R Console, make sure to update your rlang package before you do anything else to avoid errors or the update not working. The command to update rlang is as follows:

    install.packages("rlang")

    • If you need to update rlang to a specific version, not just the latest, you can use this command, where [url] is the URL to the package on CRAN's website:

      install.packages("[URL]", repo=NULL, type= "source")

    • You can also choose to update all of your R packages (including rlang) with the following command:

      update.packages(checkBuilt = TRUE)

  4. Advertisement
Section 2 of 3:

Updating Rlang With the RStudio GUI

PDF download Download Article
  1. If RStudio is currently open on your computer, close it and open it again. You can press Ctrl+Shift+F10 to restart RStudio while also clearing the global environment.
  2. It's a tab near the top of the window, between Plots and Help . Do this before you do anything else in RStudio to avoid getting errors when updating rlang.
    • You can use this window to check your rlang version if you're not sure what version you're using.
  3. This indicates that you only want to update rlang. You can check multiple boxes here if you want to update multiple packages.
  4. It's above your package list, with a green arrow button. This will check for any updates for the selected packages (rlang, in this case). [1]
    • Follow the steps presented in the GUI to update rlang.
    • You can also check for updates by clicking the Tools menu and selecting Check for Package Updates… .
  5. Advertisement
Section 3 of 3:

Troubleshooting

PDF download Download Article
  1. You likely have your settings set to save your workspace to .RData when RStudio closes. You can fix this by doing the following:
    • Go to Tools > Global Options… > General . The "General" tab is the top tab in your RStudio settings and should open by default.
    • Uncheck the box next to "Restore .RData into workspace at startup".
    • In the dropdown next to "Save workspace to .RData on exit", select Never .
    • Click Apply , then OK to save your settings. RStudio will now clear your global environment the next time you restart.
  2. Many packages are dependent on rlang. If these packages are loaded in RStudio or R Console, you won't be able to update the package. If restarting RStudio/R Console with a clear environment doesn't help, you may have to uninstall rlang completely and reinstall the newer version.
    • Load the installer package by running the following command:

      library(installr)

    • Uninstall rlang with the following command:

      uninstall.packages("rlang")

    • Restart RStudio or R Console.
    • Install rlang with the following command:

      install.packages("rlang", dependencies = TRUE)

  3. Advertisement

Expert Q&A

Ask a Question
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Name
      Please provide your name and last initial
      Thanks for submitting a tip for review!

      About This Article

      Thanks to all authors for creating a page that has been read 2,807 times.

      Is this article up to date?

      Advertisement