packages.loaded | R Documentation |
Returns TRUE if the whole set of packages entered has been loaded, or FALSE otherwise. This can be useful when developing a package where there is optional functionality depending if another package is in use (but the other package is not part of 'depends' because it is not essential). Because 'require' cannot be used within functions submitted as part of a CRAN package.
packages.loaded(pcks = "", ..., cran.check = FALSE, repos = getRepositories())
pcks |
character, a package name, or vector of names, if left blank will return all loaded |
... |
further package names as character (same as entering via pcks, but avoids need for c() in pcks) |
cran.check |
logical, in the case at least one package is not found, whether to search CRAN and see whether the package(s) even exist on CRAN. |
repos |
repository to use if package is not loaded and cran.check=TRUE, if NULL, will attempt to use the repository in getOptions("repos") or will default to the imperial.ac.uk mirror. Otherwise the default is to use all available repositories from getRepositories() |
logical TRUE or FALSE whether the whole list of packages are available
Nicholas Cooper
packages.loaded("NCmisc","reader") packages.loaded() # no argument means all loaded packages are listed
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.