Skip to content

Instantly share code, notes, and snippets.

View GokerMalik's full-sized avatar

Göker Malik Altuntaş GokerMalik

View GitHub Profile
@Mikuana
Mikuana / remove_user_packages.R
Created March 2, 2017 00:31
Remove all user installed packages from R
# Shamlessly stolen from:
# https://www.r-bloggers.com/how-to-remove-all-user-installed-packages-in-r/
# create a list of all installed packages
ip <- as.data.frame(installed.packages())
head(ip)
# if you use MRO, make sure that no packages in this library will be removed
ip <- subset(ip, !grepl("MRO", ip$LibPath))
# we don't want to remove base or recommended packages either\
ip <- ip[!(ip[,"Priority"] %in% c("base", "recommended")),]