Installs each entry in pkgs from the selected repo. Skips packages that
are already installed (unless force = TRUE). For GitHub, pass
"owner/repo" strings (e.g., "rstudio/gt").
Usage
install_packages(
pkgs,
repo = c("cran", "bioc", "github"),
dependencies = TRUE,
update = FALSE,
force = FALSE
)Arguments
- pkgs
Character vector of package identifiers.
For
repo = "cran"or"bioc": package names, e.g."dplyr".For
repo = "github":"owner/repo"strings, e.g."tidyverse/ggplot2".
- repo
One of
"cran","bioc", or"github". Default"cran".- dependencies
Logical; forwarded to
utils::install.packages()andremotes::install_github(). DefaultTRUE.- update
Logical; only used when
repo = "bioc". IfTRUE, allowBiocManager::install()to update other Bioconductor packages. DefaultFALSEto keep installs reproducible.- force
Logical; reinstall even if the package appears installed. (For GitHub, the installed check uses the package name part after
/.)
Examples
if (FALSE) { # \dontrun{
install_packages(c("dplyr","ggplot2")) # CRAN
install_packages("SummarizedExperiment", repo = "bioc") # Bioconductor
install_packages("rstudio/gt", repo = "github") # GitHub
} # }