How to uninstall R and RStudio with all packages, settings and everything else?

52,087

Solution 1

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. Uninstall R, RStudio and RTools from Windows "Programs and Features" menu.

  2. Delete everything in folders that was shown after running .libPaths() instruction in R to know where R packages are installed. In my case, it looks like:

    .libPaths()

    1 "C:/Users/%USERNAME%/Documents/R/win-library/3.6" "C:/Program Files/R/R-3.6.3/library"

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
- Various files and folders under C:\Users\%USERNAME%\AppData\Local\Temp related with R and RStudio sessions.
  1. Delete everything in C:\Users\%USERNAME%\AppData\Local\RStudio-Desktop

  2. Delete everything in C:\Users\%USERNAME%\AppData\Local\rstudio

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

  • Install R
  • Install RTools (if you need)
  • Install RStudio.

Solution 2

  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.

Share:
52,087

Related videos on Youtube

vasili111
Author by

vasili111

Updated on July 19, 2022

Comments

  • vasili111
    vasili111 almost 2 years

    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?

    • ZanCoul
      ZanCoul about 5 years
      What OS are you on? Packages might be installed in your local directory. maybe ~/.R.
    • vasili111
      vasili111 about 5 years
      @ZanCoul Windows 8.1
    • ZanCoul
      ZanCoul about 5 years
      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.
    • NelsonGon
      NelsonGon about 5 years
      Maybe not the best but maybe manually delete the folder containing the libraries and then unistall?
    • vasili111
      vasili111 about 5 years
      @ZanCoul That helped. Thank you.
  • ozturkib
    ozturkib about 4 years
    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 ?
  • Lisa B.
    Lisa B. over 3 years
    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.