R/edgeApply.R

Defines functions .edgeApply

.edgeApply <- function(g, f, dupls=TRUE, simplify=TRUE) {
  if (class(g)[1] == "graphNEL")
    M <- adjacencyMatrix(g)
  else
    M <- g

  cond <- (M == 1)
  if (!dupls)
    cond <- cond & upper.tri(M, TRUE)

  edges <- which(cond, TRUE)
  mapply(f, edges[, "row"], edges[, "col"], SIMPLIFY=simplify)
}

Try the QuACN package in your browser

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

QuACN documentation built on May 2, 2019, 5:46 p.m.