trinker / pacman

A package management tools for R
311 stars 37 forks source link

Feature Request/Improvement: p_update neglects bioconductor packages #114

Open r-cheologist opened 5 years ago

r-cheologist commented 5 years ago

Currently, pacman::p_update is defined like so:

function (update = TRUE, ask = FALSE, ...) 
{
    p_set_cranrepo()
    out <- unname(utils::old.packages()[, 1])
    if (update) {
        utils::update.packages(ask = ask, ...)
        return(invisible(out))
    }
    out
}

and accordingly disregards bioconductor packages when updating.

function (update = TRUE, ask = FALSE, ...) 
{
    p_set_cranrepo()
    out <- unname(utils::old.packages()[, 1])
    if (update) {
        if(p_exists(BiocManager)){
            BiocManager::install(ask = ask, ...)
        } else {
            utils::update.packages(ask = ask, ...)
        }
        return(invisible(out))
    }
    out
}

should take care of that and update packages independent of whether they are from bioconductor or CRAN. BUT: the update = FALSE case (and the return value in general) appears tricky: I couldn't find any BiocManager functionality that would return outdated packages (and in particular bioconductor ones).

Sincerely, Joh