Automate Retrieving, Building, Installing and Loading
Specified Packages
Barry
Zeeberg
Packages required for the search path may be located in the CRAN
repository, the system library, or a local directory.
autoLibLoad() automates determining the disposition of each
required package, retrieving it, and loading it as needed.
If
one of the required packages is already in the search path, we omit that
package from the remainder of the processing.
For the missing
packages, we first determine if that package is installed in the system
library. If so, we simply load that package using the library()
command.
Otherwise, we determine if that package is available
from the authentic CRAN repository. If so, we install it using the
install.packages() command, and then load it using the
library() command.
Finally, any packages that are
still missing might or might not be available from a designated local
directory. If so, these are loaded using the command
install.packages(package_list, repos = NULL, type = ‘source’)
The disposition of all the desired packages is returned by
autoLoad() in a list, in particular noting which packages were
successfully loaded in the search path.