12.07.2015 Views

Package 'NCmisc' - HEAnet Mirror Service

Package 'NCmisc' - HEAnet Mirror Service

Package 'NCmisc' - HEAnet Mirror Service

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

must.use.package 23must.use.packageDo everything possible to load an R package.DescriptionLike ’require()’ except it will attempt to install a package if necessary, and will also deal automaticallywith bioconductor packages too. Useful if you wish to share code with people who may nothave the same libraries as you, you can include a call to this function which will simply load thelibrary if present, or else install, then load, if they do not have it.Usagemust.use.package(pcknms, bioC = FALSE, ask = FALSE, reload = FALSE,avail = FALSE, quietly = FALSE)ArgumentspcknmsbioCreloadavailaskquietlylist of packages to load/install, shouldn’t mix bioconductor/CRAN in one callwhether the listed packages are from bioconductorindicates to reload the package even if loadedwhen bioC=FALSE, see whether pcknms are in the list of available CRAN packageswhether to get the user’s permission to install a required package, or just goahead and do itpassed to library/require, display installation text or notValuenothing, simply loads the packages specified if possibleAuthor(s)Nicholas Cooper Examples# not run : run if you are ok to install/already have these packages# must.use.package(c("MASS","nlme","lme4"),ask=FALSE)# must.use.package("limma",bioC=TRUE)# search() # show packages have loaded, then detach them again:# sapply(paste("package",c("limma","MASS","nlme","lme4"),sep=":"),detach,character.only=TRUE)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!