View source: R/Library_installer.R
install_and_load | R Documentation |
This function checks for and installs missing CRAN and Bioconductor libraries, and then loads all specified libraries.
install_and_load(
packages = c("VennDiagram", "grid", "caret", "fields", "ggplot2", "InterSIM",
"tidyverse", "splatter", "NMF", "stringr", "r.jive", "psych", "gridExtra")
)
packages |
Character vector. A vector of CRAN package names to install and load. |
None.
# Define the required libraries
libraries <- c("VennDiagram", "grid", "caret", "fields", "ggplot2", "InterSIM", "tidyverse", "splatter", "NMF", "stringr")
# Check for and install Bioconductor packages separately
bioc_packages <- c("Biobase", "splatter")
missing_bioc_packages <- bioc_packages[!(bioc_packages %in% installed.packages()[, "Package"])]
if (length(missing_bioc_packages) > 0) {
BiocManager::install(missing_bioc_packages)
}
# Install and load CRAN packages
install_and_load(libraries)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.