#!/usr/bin/env r instPkgs <- installed.packages(lib.loc="/usr/lib/R/library") instPkgs <- instPkgs[ instPkgs[,"Priority"] == 'base', ] for (pkg in rownames(instPkgs)) { message(pkg) }