Learn R Programming

evanverse (version 0.4.0)

update_pkg: Update R Packages

Description

Update R packages from CRAN, GitHub, or Bioconductor. Supports full updates, source-specific updates, or targeted package updates. Automatically handles version compatibility checks and respects mirror settings.

Usage

update_pkg(pkg = NULL, source = NULL, ...)

Value

NULL (invisibly). Side effect: updates packages.

Arguments

pkg

Character vector. Package name(s) to update. For GitHub, use "user/repo" format. Only required when source is specified.

source

Character. Package source: "CRAN", "GitHub", or "Bioconductor". Optional if updating all installed CRAN and Bioconductor packages.

...

Additional arguments passed to install.packages, install_github, or install.

Examples

Run this code
if (FALSE) {
# Update all CRAN + Bioconductor packages:
update_pkg()

# Update all CRAN packages only:
update_pkg(source = "CRAN")

# Update specific package:
update_pkg("ggplot2", source = "CRAN")

# Update GitHub package:
update_pkg("hadley/ggplot2", source = "GitHub")
}

Run the code above in your browser using DataLab