Written and maintained by CASRAI Editorial Board
Last updated
Quick answer: R and RStudio are updated separately. Install the new R from CRAN, then point RStudio at it (Tools > Global Options > General > Basic > R Sessions > Change next to R Version). A patch update (for example 4.5.1 to 4.5.2) needs nothing else; a change in the first two numbers (for example 4.4 to 4.5) means reinstalling your packages, because the new version uses a different personal library.
This guide is for analysts and researchers who run R through RStudio on Windows or in a shared environment and want to move to a newer R without breaking their analyses. Sources were read on 2026-11-07; CRAN and Posit revise these pages, so confirm the current release number on CRAN rather than relying on any number quoted here.
What updating R and RStudio means in research work
RStudio is an interface; R is the engine that runs your code. Posit’s documentation states that RStudio supports multiple R versions side by side, so RStudio has to select one. Updating “RStudio” therefore does not change which R your analyses use, and installing a new R does not change RStudio. Treat them as two independent steps.
R version numbers follow major.minor.patchlevel (for example 4.5.2). The R FAQ on CRAN describes this scheme, and the rule that decides how much work an update is hinges on it:
- Patch update (same x.y, such as 4.5.1 to 4.5.2): according to the R for Windows FAQ, nothing has to be done; you may optionally run
update.packages(checkBuilt=TRUE, ask=FALSE). - Minor or major update (different x.y, such as 4.4.x to 4.5.x): you must install the packages you need again. The new version uses a different personal library, and the old library stays intact.
Step 0: Check your current R and library locations
Before changing anything, record where you are. In the R console:
R.version.stringprints the running R version..libPaths()lists the library folders R searches.Sys.getenv("R_LIBS_USER")shows the personal library setting. The R for Windows FAQ gives this as the way to check the personal library location.- Save a list of what you use so you can reinstall it later, for example
pkgs <- rownames(installed.packages())followed bysaveRDS(pkgs, "pkgs.rds").
If your project records its package versions with renv, see our renv guide; a lockfile gives you the exact list to restore after an update.
How to update R (Windows)
These steps follow the R for Windows FAQ on CRAN (questions 2.7 and 2.8).
- Download the installer from the Windows binaries page on CRAN (the installer file name carries the version, in the form R-x.y.z-win.exe). Check CRAN for the current release.
- Choose how to handle the old version. You can uninstall it first through Programs and Features (or its unins000.exe), or install the new version alongside it. Uninstalling removes only the files from the initial installation, not packages you added later.
- Run the new installer. Each version installs to a versioned folder, for example
C:\Program Files\R\R-4.5.0\bin\x64. - If the x.y part changed, reinstall your packages in the new version (see below). Per the FAQ, installed packages should not be copied from the old library to the new one, because they may be incompatible.
If your .Rprofile loads a package with library(foo), the FAQ advises starting R with --vanilla before updating that package, so a startup error does not block the update.
For macOS and Linux, follow the instructions on the CRAN download pages for your system; the version rules above apply on every platform.
How to update R in RStudio
RStudio does not install R for you. After installing the new R, tell RStudio to use it:
- Open Tools > Global Options > General > Basic.
- Under R Sessions, click Change next to R Version and pick the new installation. (Posit documents this path for Windows.)
- Restart the R session, then run
R.version.stringto confirm.
Alternatively, hold Ctrl while RStudio starts to open the Choose R Installation dialog, as described in the Posit documentation on managing R. Posit also recommends rig, the R Installation Manager (macOS, Windows and Linux); its documented example, rig rstudio 4.3.0, starts RStudio with R 4.3.0.
How to update RStudio
RStudio itself is the Posit IDE, and it is updated by installing a newer RStudio build over the old one; this does not touch your R installation or your packages. RStudio requires R 3.6.0 or higher per Posit’s documentation, so any R you would reasonably use is supported. Posit’s download page offers the current installer; check it for the current version rather than relying on a number quoted in a guide.
Reinstall and update packages
After a minor or major R update, your new personal library is empty of the packages you added yourself. Reinstall the names you saved in Step 0, for example install.packages(readRDS("pkgs.rds")). Our guide to installing R packages covers sources and common install errors. Packages installed from places other than CRAN need to be reinstalled from their own source.
To refresh packages inside an existing R version, update.packages() is the standard function; the checkBuilt=TRUE form quoted above rebuilds packages built under an earlier R of the same x.y series.
Check the result
| Check | Command or place | What you should see |
|---|---|---|
| R version in use | R.version.string |
The new x.y.z |
| Library folders | .libPaths() |
A personal library for the new x.y (on Windows with R 4.2.0 or later, an R\win-library\x.y folder under %LOCALAPPDATA%) |
| Personal library setting | Sys.getenv("R_LIBS_USER") |
The path R will use for your own packages |
| RStudio’s R choice | Tools > Global Options > General > Basic > R Sessions | The R installation you selected |
Troubleshooting
RStudio still reports the old R version
Both versions are installed and RStudio is set to the old one. Use the R Version Change button described above, or hold Ctrl at startup to choose.
My packages are missing after the update
Expected after an x.y change: the new version uses a separate personal library, and the old one is left intact. Reinstall from your saved list. The old library can be deleted manually once you no longer need it.
R fails during update because of a startup package
If .Rprofile contains library(foo), start with --vanilla before updating foo.
I am on shared or managed hardware
If you cannot install software, a hosted option avoids the issue; see RStudio on the cloud. For orientation in the IDE, see how to use RStudio.
Ways to manage R versions
| Approach | What it does (per the cited documentation) | Source |
|---|---|---|
| Install new R alongside the old | Versions install to versioned folders; the old library stays intact | R for Windows FAQ |
| Uninstall old, install new | Removes files from the initial installation only | R for Windows FAQ |
| RStudio Change R Version / Ctrl at startup | Selects which installed R RStudio runs | Posit documentation |
| rig (R Installation Manager) | Manages multiple R versions on macOS, Windows and Linux; can start RStudio with a given R | Posit documentation |
Frequently asked questions
How do I update RStudio?
Install a newer RStudio build from Posit’s download page. This is separate from updating R, and your packages and R installation are unaffected.
How do I update R in RStudio?
Install the new R from CRAN, then choose it in Tools > Global Options > General > Basic > R Sessions > Change (next to R Version) and restart the session.
Do I need to reinstall packages when I update R?
Only if the x.y part of the version changes; a patch update needs nothing.
Can I copy my old library into the new one?
The R for Windows FAQ says not to, because the packages may be incompatible. Reinstall instead.
Will updating R change my results?
It can. For reproducible work, record sessionInfo() with each analysis and consider locking package versions with renv.
Sources
- CRAN, R for Windows FAQ, cran.r-project.org/bin/windows/base/rw-FAQ.html (read 2026-11-07).
- Posit, Managing R (RStudio user guide), docs.posit.co/ide/user/ide/guide/environments/r/managing-r.html (read 2026-11-07).
- CRAN, R FAQ, cran.r-project.org/doc/FAQ/R-FAQ.html (read 2026-11-07).







