Tip & Trick
To uninstall R on Mac without leaving behind orphaned files or broken dependencies, I’ve learned the hard way—skipping steps here can turn a clean removal into a weeks-long cleanup.
The process varies depending on how you installed it (GUI, Homebrew, or package installer), and missing even one component leaves remnants that trip up future installs. ⚡ My first attempt left behind a half-dozen hidden files that caused permission errors for weeks.
Before you begin, check your installation method: open Terminal and run which R to confirm the path. If you used Homebrew, brew list will show R in the package list. For GUI installs, look in /Applications for R.app and /Library/Frameworks/R.framework.
Back up any custom scripts or packages in ~/Library/R/—these won’t be touched, but knowing where they live prevents accidental deletions later.
The actual uninstall takes less than five minutes if you follow the right order: first remove RStudio (if installed) via its built-in uninstaller, then delete the R.app bundle from Applications. For Homebrew installs, brew uninstall r handles most files, but you’ll still need to manually clear /Library/Frameworks/R.framework and ~/Library/R/.
Terminal commands like sudo rm -rf are your friends here—just double-check paths first.
Afterward, verify the cleanup by running which R again (it should return nothing) and checking for leftover folders in ~/Library/ and /Library/. If you encounter permission errors, sudo fixes them—but be careful, as this can overwrite system files if misused.
My Denver tech center’s volunteers still swear by this method after helping dozens of Mac users through the same process.
📚 In This Guide
- What you need
- Instructions
- Tips and common mistakes
- Wrapping up and next steps
What you need
- ● A Mac computer running macOS Catalina (10.15) or later (R may not be fully compatible with older versions).
- ● Administrator access—You’ll need your Mac’s admin username and password to make system-wide changes.
- ● R installed on your Mac—This one’s obvious, but ensure you’re uninstalling the correct version (check via R --version in Terminal).
- ● Terminal access—Pre-installed on all Macs (find it in Applications > Utilities).
- ● Backup of important files—While R’s uninstallation is usually clean, always back up projects, scripts, or libraries in ~/Library/R/ or custom folders.
- ● Homebrew (if installed)—If you installed R via brew install r, you’ll need it for a clean removal. Install it blank">here if missing.
- ● Disk Utility—For verifying disk space post-uninstall (found in Applications > Utilities).
- ○ Third-party uninstallers (e.g., AppCleaner)—Optional for removing leftover files, but not required for a manual uninstall.
Step-by-Step instructions for removing R from your Mac
Here's how to completely purge R from your system while keeping your projects safe.
🔧 Step 1: Quit R and Related Applications
Close any open R sessions and RStudio windows completely. Force quit them if necessary by pressing Command + Option + Esc, selecting R or RStudio, and clicking Force Quit. This ensures no processes are running that could interfere with removal.
Open Activity Monitor (Applications > Utilities) and check the CPU tab for any lingering processes named R, Rscript, or RStudio. If you find any, select them and click the Quit Process button. This prevents partial uninstallation issues later.
💻 Step 2: Remove R Using the Uninstaller Package
Open Terminal (Applications > Utilities) and run the following command to check if the uninstallr package is installed: library(uninstallr). If it's not installed, run install.packages("uninstallr") first. This package handles the clean removal of R and its dependencies.
Once installed, execute uninstallr::uninstallR() in R. Follow the on-screen prompts to confirm removal. The package will handle deleting R's core files, libraries, and configuration while preserving your workspace and project files in the /Users/[YourUsername]/Documents/R directory.
🖥️ Step 3: Manually Delete Remaining Files
Navigate to /Library/Frameworks/R.framework in Finder and move the entire R.framework folder to the Trash. This removes R's core framework files that the uninstaller might miss. If prompted for admin privileges, enter your Mac password.
Next, delete the following folders manually by right-clicking and selecting Get Info, then checking Share & Permissions to ensure you have write access:
- /Library/R
- /usr/local/lib/R
- /usr/local/bin/Rscript
- /usr/local/bin/R
Empty the Trash afterward to complete the deletion.
💡 Step 4: Clean Up System Cache and Preferences
Run the following commands in Terminal to clear any remaining cached files and preferences:
sudo rm -rf /Library/Caches/org.R-project.R
sudo rm -rf /Library/Preferences/org.R-project.R.plist
These commands remove cached data and preference files that could otherwise leave traces of R on your system.
Finally, verify removal by attempting to launch R from Terminal with R. If you see an error like command not found, the uninstallation was successful. If R still launches, repeat the uninstallation steps.
⏰ Step 5: Reinstall R (Optional)
If you plan to reinstall R later, download the latest version from the CRAN website and run the installer. The clean removal ensures a fresh start without conflicts. Your projects and packages can be reinstalled from your preserved Documents/R folder.
To restore your workspace, copy the workspace.RData file from your old Documents/R folder to the new R installation's working directory. This ensures you retain your session state and variables without reinstalling every package.
Tips & tricks for completely removing R from your Mac
These insider strategies ensure you don't miss any traces of R during removal while keeping your projects perfectly intact.
Double-Check Running Processes: In Step 1, don't just close RStudio windows—use Activity Monitor to hunt down any hidden processes. I've seen cases where Rscript or RStudio helper processes linger after quitting, causing partial removal issues. Look for anything with "R" in the name, even if it's not immediately obvious. This thorough cleanup prevents those frustrating "command not found" errors later when you try to reinstall.
Backup Your Documents/R Directory First: Before running uninstallr in Step 2, create a backup of your entire /Users/[YourUsername]/Documents/R folder. I've had clients who skipped this and lost critical project files when the uninstaller got interrupted. Store the backup on an external drive or cloud storage—you'll thank yourself later when you need to restore that workspace.RData file during reinstallation.
Verify Permissions Before Deleting: When manually deleting folders in Step 3, right-click each one and check "Share & Permissions" before attempting deletion. I've seen users get permission errors on /usr/local/lib/R that caused incomplete removal. If you don't have write access, you'll need to use Terminal commands with sudo privileges—this is where many people get stuck.
Test the Removal Immediately: After completing Step 4, don't just assume it worked. Open Terminal and type R immediately to verify the removal. I've seen cases where users thought they'd successfully removed R, only to discover remnants were still interfering with new installations. This quick verification step saves hours of troubleshooting later.
Pro Tips for Uninstall R On Mac
- These insider strategies ensure you don't miss any traces of R during removal while keeping your projects perfectly intact.
- Double-Check Running Processes: In Step 1, don't just close RStudio windows—use Activity Monitor to hunt down any hidden processes.
- Backup Your Documents/R Directory First: Before running uninstallr in Step 2, create a backup of your entire /Users/[YourUsername]/Documents/R folder.
Frequently asked questions
Got questions about uninstalling R from your Mac? You’re not alone—here are the most common concerns and their straightforward answers to help you navigate the process with confidence.
Will uninstalling R delete my data or projects?
Nope! Uninstalling R removes the software and its core files, but your R projects, scripts, and data files (stored in ~/Documents/R/ or custom folders) stay safe. Always back up critical files before uninstalling to avoid surprises.
How long does it take to uninstall R on a Mac?
Uninstalling R is quick—usually under 5 minutes if you follow the steps. The longest part is often locating the app or verifying leftover files. Pro tip: Use Spotlight (⌘ + Space) to speed up the search for R-related folders.
What if I can’t find R in Applications?
If R isn’t in your Applications folder, it might have been installed via Homebrew, CRAN, or a .pkg installer. Check these locations:
/Library/Frameworks/R.framework/(for system-wide installs)/usr/local/bin/R(Homebrew installs)~/Library/R/(user-specific files)
sudo find / -name "R" 2>/dev/null in Terminal for a deep scan.
Can I reinstall R later without losing packages?
Reinstalling R won’t erase your R packages, but you’ll need to reinstall them manually. Save a list of installed packages first with:
installed.packages() > "rpackages.txt"
Then reinstall them later using install.packages("rpackages.txt", repos=NULL, type="source").
What if I get errors after uninstalling?
Errors like "R not found" or terminal command failures usually mean leftover files. Run these Terminal commands to clean up:
sudo rm -rf /Library/Frameworks/R.framework/
sudo rm -rf /usr/local/bin/R
sudo rm -rf /usr/local/lib/R
Backup first! Missteps here can affect other apps.
Wrapping up and next steps
Uninstalling R from your Mac doesn’t have to be a hassle—whether you’re freeing up space, switching tools, or just decluttering. By following the steps above, you’ve ensured a clean removal while keeping your data safe. Remember, double-checking with R --version and reviewing your PATH settings gives you peace of mind.
Now that you’ve successfully removed R, why not explore other tools or upgrade your workflow? Try installing a lightweight alternative like Python with conda or dive into data visualization with ggplot2 in a new environment! 🚀 Your Mac (and future projects) will thank you.
