Skip to contents

A unified installer for R packages from CRAN, GitHub, Bioconductor, or local source.

Usage

inst_pkg(
  pkg = NULL,
  source = c("CRAN", "GitHub", "Bioconductor", "Local"),
  path = NULL,
  ...
)

Arguments

pkg

Package name(s) or GitHub repo (e.g., "user/repo"). Not required for source = "local".

source

Source of package: "CRAN", "GitHub", "Bioconductor", "local". Case-insensitive, shorthand allowed.

path

Path to local package file (used when source = "local").

...

Additional arguments passed to install.packages(), devtools::install_github(), or BiocManager::install().

Value

NULL (invisibly)

Examples

# Basic usage (commented to avoid network operations):
# inst_pkg("dplyr", source = "CRAN")
# inst_pkg("hadley/emo", source = "GitHub")
# inst_pkg("scRNAseq", source = "Bioconductor")
# inst_pkg(source = "local", path = "mypackage.tar.gz")