R/productOfRowSums.R

Defines functions productOfRowSums

Documented in productOfRowSums

productOfRowSums <- function(g, dist=NULL, log=FALSE){
  if(class(g)[1]!="graphNEL"){
    stop("'g' must be a 'graphNEL' object")
  }
  stopifnot(.validateGraph(g))
  
  if(is.null(dist)){
    dist <- distanceMatrix(g)
  }
  if(log==FALSE){
    return(prod(apply(dist,1,sum)))
  }else{
    return(log2(prod(apply(dist,1,sum))))
  }
}

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.