A unified function to update R packages by source. Supports full updates, source-specific updates, or targeted package updates. Automatically sets mirrors (Tsinghua CRAN, Tsinghua Bioconductor) and handles version compatibility checks. Ensures Bioconductor installations specify the correct version to avoid mismatches.
update_pkg(pkg = NULL, source = NULL)Invisible NULL. Outputs update progress and logs via cli.
Character vector. Name(s) of package(s) to update. For GitHub, use "user/repo" format.
Only required when source is specified.
Character. The source of the package(s): "CRAN", "GitHub", or "Bioconductor".
Optional if updating all installed CRAN and Bioconductor packages.