How to uninstall R on Windows
Keep scripts, datasets, saved workspaces and personal packages before uninstalling R. Removing one R version should not remove another version, RStudio or project directories.
Save your data and quit
Before quitting R, run getwd() and .libPaths() in its console to locate the current working directory and libraries. Copy wanted project files and note package requirements, then close R and any IDE session using that version. A library inside the version’s program directory can be removed with that version, so inspect it first.
Uninstall the tested package
In Windows 11, open Settings › Apps › Installed apps, find R, and choose Uninstall. In Windows 10, use Settings › Apps › Apps & features. Keep the installed program folder intact until its uninstaller finishes. If this was the winget package, first confirm its exact identity:
winget list --id RProject.R --exact
If the successful query shows the intended installation, remove that package:
winget uninstall --id RProject.R --exact
This follows the package’s registered removal method; portable packages use their package-manager removal instead. An error or a missing winget match is not proof that the app is absent: check the Windows app list and the original installation method. Follow any vendor confirmation or restart request after saving other work. See Microsoft’s uninstall command documentation.
Data and components to check
The following locations or components need separate decisions. A remaining folder is not automatically disposable.
| Location or component | What to keep or check |
|---|---|
getwd() |
The project working directory; retain scripts, data and workspace files there. |
.libPaths() |
The actual library directories for this R session; preserve personal libraries and identify version-specific ones. |
See R’s official documentation.
Check the outcome
winget list --id RProject.R --exact
A successful package query with no matching row means that package registration was not found. A matching row means it still exists; an error leaves the result unknown. Keep deliberately retained data. Check Task Manager for a process whose executable belongs to this installation, and distinguish another version or a separate companion app before acting.
What Mole lists
By the time Mole checked for leftovers, the program folder and shortcuts were already gone. Mole removed R’s usage record and left Windows BITS service changes alone.
What this test covered
The Windows Inno machine installation was opened in the R GUI and uninstalled. No applicable update was listed, and upgrade execution was not tested. This run did not validate restoring a personal package library or reproducing every analysis environment.
These results are from a development build of Mole. Other released builds were not individually tested.
