43

I messed up something and there is a problem with tidyverse. Tried to find a solution but spend lots of time without result.

How to uninstall R and RStudio with all packages, settings and everything else on Windows. I tried to uninstall through Windows uninstall menu and after I installed R and RStudio again same packages appeared as they were installed before. How can I erase everything related to R and RStudio so I be able to make a fresh install?

5
  • What OS are you on? Packages might be installed in your local directory. maybe ~/.R.
    – ZanCoul
    Commented Mar 17, 2019 at 5:08
  • @ZanCoul Windows 8.1
    – vasili111
    Commented Mar 17, 2019 at 5:09
  • 3
    Open R or Rstudio and type .libPaths() this will show you where all the packages are installed. Just make sure that everything in those folders are deleted after you uninstall R. Good luck.
    – ZanCoul
    Commented Mar 17, 2019 at 5:11
  • Maybe not the best but maybe manually delete the folder containing the libraries and then unistall?
    – NelsonGon
    Commented Mar 17, 2019 at 5:25
  • @ZanCoul That helped. Thank you.
    – vasili111
    Commented Mar 17, 2019 at 6:54

2 Answers 2

51

I have further issues with the previous answer. For that reason, I have extended the answer with further steps (which I experienced currently) as below:

  1. Run .libPaths() and save the listed directories shown on the RStudio console. In my case, it looks like:
.libPaths()

"C:/Users/%USERNAME%/Documents/R/win-library/3.6" 
"C:/Program Files/R/R-3.6.3/library"
  1. Uninstall R for Windows, RStudio and RTools from Windows "Programs and Features" menu. You might navigate there through: Add or remove programs > App & features > On search box

  2. Delete everything in folders that was shown after running .libPaths() instruction in R to know where R packages are installed.

Therefore, I have manually deleted following files and folders (they remain there after full uninstallation of R, RStudio and RTools) as well:

C:\Users\%USERNAME%\Documents\R\
C:\Users\%USERNAME%\Documents\.Rhistory
C:\Users\%USERNAME%\AppData\Local\Temp > only specific ones mentioned below.

Specific ones can be various files and folders which can be deleted under this directory related with R and RStudio sessions. In my case, Rtmpcx1qAZ, Rtmpk7UXWj, Rscript3d2438240e1, ... are only example files or folder names to give you rough idea.

  1. Delete everything inside those listed folders or completely delete those listed folders as well:
C:\Users\%USERNAME%\AppData\Local\R
C:\Users\%USERNAME%\AppData\Local\rstudio
C:\Users\%USERNAME%\AppData\Local\RStudio-Desktop
C:\Users\%USERNAME%\AppData\Local\r-miniconda
C:\Users\%USERNAME%\AppData\Local\r-reticulate
C:\Users\%USERNAME%\AppData\Local\??? (!!!might be some others in your case!!!)
C:\Users\%USERNAME%\AppData\Roaming\R
C:\Users\%USERNAME%\AppData\Roaming\RStudio

Then you can move on the re-installation side for R as below (after suggested reboot of Windows). In order (please): Download R for Windows, (download RTools if you need) and RStudio Desktop.

1
  • 1
    Worked for me! Tidyverse works fine now. I updated to R 4.0.3 and also had problems with tidyverse that I could not fix even after long searches. Then I tried to reinstall tidyverse in the shell and it was fine.
    – Lisa B.
    Commented Feb 5, 2021 at 8:21
9
  1. Run .libPaths() and save the two directories shown on the console

  2. Uninstall R and RStudio from Windows "Programs and Features" menu.

  3. Delete everything in folders that was shown after running .libPaths() in R.

  4. Delete everything in c:\Users\%USERNAME%\AppData\Local\RStudio-Desktop\

  5. Install R and after Rstudio.

All packages where deleted and I think all Rstudio settings too.

2
  • 1
    How about the packages under C:\Users\%USERNAME%\AppData\Local\Temp ? In my case, there are various folders which might had previously generated through rstudio sessions. How can we know which ones are generated by rstudio and should delete them manually ?
    – ozturkib
    Commented Apr 13, 2020 at 10:56
  • Typo : "All packages WERE deleted"
    – Julien
    Commented Jan 2, 2023 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.