R/PlotTransitionNetwork.R

PlotTransitionNetwork <-
function(Q, main="", layout.fn = layout.circle, ...) {
	diag(Q) <- 0
	Q[which(is.na(Q))] <- 0
	Q<-Q/max(Q)
	g <- graph.adjacency(Q, weighted=TRUE, mode="directed")
	g.layout <- layout.fn(g)
	plot(g, layout=g.layout, edge.width=10*get.edge.attribute(g, "weight"), edge.curved=TRUE, ...)
}
bomeara/RateViz documentation built on May 12, 2019, 11:34 p.m.