R/bertz.R

Defines functions bertz

Documented in bertz

bertz <- function(g,dist=NULL,deg=NULL){
  if(class(g)[1]!="graphNEL"){
    stop("'g' must be a 'graphNEL' object")
  }
  stopifnot(.validateGraph(g))

  if(is.null(dist)){
    dist <- distanceMatrix(g)
  }
  if(is.null(deg)){
    deg <- graph::degree(g)
  }
  Ni <- .cardNi(g,dist,deg)
  N <- sum(Ni)
  return((2*N*log2(N))- sum(Ni*log2(Ni)))
}

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.