R/basicInstallOrder.R

Defines functions basicInstallOrder

Documented in basicInstallOrder

basicInstallOrder <- function(pkg, depG) {
    ## Helper function to return the complete install order
    ## for the given package.
    allPkgs <- c(pkg, names(acc(depG, pkg)[[1]]))
    if (length(allPkgs) > 1) {
        pkgSub <- subGraph(allPkgs, depG)
        toInst <- tsort(pkgSub) 
        if (!is.character(toInst))
          stop("depG is not a DAG")
        rev(toInst)
    } else {
        allPkgs
    }
}

Try the pkgDepTools package in your browser

Any scripts or data that you put into this service are public.

pkgDepTools documentation built on Nov. 8, 2020, 5:24 p.m.