View source: R/package-loading.R
load_packages | R Documentation |
Utility function to load and optionally install packages if they are missing. When the function terminates, packages are installed (if necessary) and loaded. Upgradeable packages are shown.
load_packages( ..., install_packages = TRUE, force_install = FALSE, show_outdated_packages = FALSE, default_loading_method = FALSE, return_library_statements = FALSE )
... |
list of package names. |
install_packages |
whether to install the selected packages. |
force_install |
whether to install packages even if they are installed already. |
show_outdated_packages |
whether to show a list of packages which are outdated. |
default_loading_method |
load according to the default R method using only |
return_library_statements |
makes this function only return a string containing |
load_packages
optionally installs, upgrades and attaches packages to the work space for a list of specified packages.
Returns invisibly a list with additional package information and results of installing/upgrading and loading.
install.packages
for installation of new packages,
update.packages
for updating outdated packages,
library
for load and attaching packages.
Other developer functions:
crossref_description()
,
generic_implementations()
,
update_settings()
,
valid_pkgname()
## Not run: # Package names given one-by-one or in a vector load_packages(c('magrittr', 'dplyr')) load_packages('magrittr', 'dplyr') # Package names may be unquoted load_packages(magrittr, dplyr) load_packages('magrittr','dplyr', install_packages=FALSE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.