R/adj.get.hops.R

## function to compute the shortest path
'adj.get.hops' <- 
function(adjmat) {
	#require(RBGL)
	hops <- RBGL::floyd.warshall.all.pairs.sp(as(adjmat,"graphNEL"))
	#dimnames(hops) <- dimnames(adjmat)
	hops[abs(hops) == Inf] <- NA
	return(hops)
}

Try the predictionet package in your browser

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

predictionet documentation built on Nov. 8, 2020, 7:48 p.m.