R/harary.R

Defines functions harary

Documented in harary

harary <- function(G){
if(nrow(distances(G)) == 0){har = NA}
if(nrow(distances(G)) > 0){
  inv.dist <- 1/distances(G, mode = "in")
har <- 0.5 * sum(ifelse(inv.dist==Inf, 0, inv.dist))}
  har
}

Try the streamDAG package in your browser

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

streamDAG documentation built on Oct. 7, 2023, 1:08 a.m.