Update and Remove R Packages

June 13, 2018    R-notes   

For some reason, updating packages on my Macbook Air often fails. I get an error like:

Error in install.packages : cannot remove prior installation of package ‘data.table’

Not super useful. But I need to go to /Library/Frameworks/R.framework/Versions/3.5/Resources/library (ugh, that’s gross) and delete the package that cannot be removed. Then install.packages("BLAH") will work just fine.