Skip to content
Prev 263201 / 398502 Next

General Plotting Commands Help

This is off the topic, but when you use require(packageName)
you only get a warning and an invisibly returned value of FALSE
if the package is not installed so shouldn't it be called
wouldLikeToLoadPackage(packageName)?  library(packageName) has
the advantage that it throws an error if packageName is not
installed.

My real question is whether there is a standard function
to load a package, installing it if it is not already installed?
This might be useful in a cloud computing environment, where you
might install just R on a new machine in the cloud and have it
install packages as needed instead of you having to know which
packages need to be installed before running your job.  You
would just have to make sure options("repos") was set so that
the install.packages() calls would work.