R/reverseEdgeDirections.R

Defines functions reverseEdgeDirections

Documented in reverseEdgeDirections

reverseEdgeDirections <- function(g) {
    ## FIXME: This needs to fix edge attributes, but for now, we punt
    ## and we are only using node attrs here anyhow...
    gam <- as(g, "graphAM")
    nodeNames <- nodes(g)
    gam@adjMat <- t(gam@adjMat)
    colnames(gam@adjMat) <- nodeNames
    as(gam, "graphNEL")
}

Try the graph package in your browser

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

graph documentation built on Nov. 8, 2020, 6:02 p.m.