Given a package name, either as a string or object, load the package if it exists, else install it from CRAN and then load
GetPackage(package)
GetPackage('gam')Loading required package: gamLoading required package: splinesLoading required package: foreachforeach: simple, scalable parallel programming from Revolution Analytics Use Revolution R for scalability, fault tolerance and more. http://www.revolutionanalytics.comLoaded gam 1.14