must.use.package | R Documentation |
Like 'require()' except it will attempt to install a package if necessary. Installation of bioconductor packages is deprecated. Useful if you wish to share code with people who may not have the same libraries as you, you can include a call to this function which will simply load the library if present, or else install, then load, if they do not have it.
must.use.package( pcknms, ask = FALSE, reload = FALSE, avail = FALSE, quietly = FALSE )
pcknms |
list of packages to load/install |
ask |
whether to get the user's permission to install a required package, or just go ahead and do it |
reload |
indicates to reload the package even if loaded |
avail |
see whether pcknms are in the list of available CRAN packages |
quietly |
passed to library/require, display installation text or not |
nothing, simply loads the packages specified if possible
Nicholas Cooper njcooper@gmx.co.uk
# not run : run if you are ok to install/already have these packages # must.use.package(c("MASS","nlme","lme4"),ask=FALSE) # search() # show packages have loaded, then detach them again: # sapply(paste("package",c("MASS","nlme","lme4"),sep=":"),detach,character.only=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.