View source: R/packageLoading.R
createPkgLoader | R Documentation |
This function creates a package loader function that can install and load packages from CRAN, Bioconductor, or GitHub, optionally displaying verbose output. This function can be useful in new R instances with little dependencies available.
The function takes the following arguments:
cran
bioc
gh
verbose
where cranand
bioctake character vectors of package names on CRAN and Bioconductor, while
ghtakes character vectors with the formatting
githubUsername/packageName.
verbose' takes in a logical for whether
to display additional informative messages in the REPL.
The function will not install packages that can already be loaded by default.
createPkgLoader(lib = .libPaths()[1])
lib |
A character vector specifying the library directory for package
installation of the output function. Defaults to the current default
package installation directory in |
A function that installs and loads packages.
# Create the package loader function
loader <- createPkgLoader()
# # commented usage example
# loader(
# cran = c("dplyr", "ggplot2"),
# bioc = c("GenomicRanges", "Biobase"),
# gh = c("tidyverse/dplyr"),
# verbose = FALSE
# )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.