View source: R/load_or_install.R
load_or_install | R Documentation |
Loads packages or, if not already installed, installs and loads packages.
load_or_install(package_names, ...)
package_names |
Character vector of one or more package names. |
... |
Additional arguments for |
Loads packages that are already installed, and if the packages are not already installed, it installs and then loads them.
Loaded packages.
https://www.r-bloggers.com/2012/05/loading-andor-installing-packages-programmatically/ https://stackoverflow.com/questions/4090169/elegant-way-to-check-for-missing-packages-and-install-them
Other packages:
getDependencies()
## Not run:
old <- options("repos")
options(repos = "https://cran.r-project.org")
# Warning: the command below installs packages that are not already installed
load_or_install(c("tidyverse","nlme"))
options(old)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.