hasPackages(pkg)
hasPackages(c("r-base-core", "somethingThatDoesNotExist"))
Run the code above in your browser using DataLab