R/plotG.R

Defines functions plotG

Documented in plotG

plotG  <- function(G, mod, vertex.size = 5, label = TRUE, main = "Network"){
	p <- ncol(G)
	path <-  abs(sign(G)) - diag(rep(1,p))
	adj <- graph.adjacency(path, mode = mod)
	if(label) id <- colnames(G) else id <- NA
	l <- layout.fruchterman.reingold(adj)
	plot(adj, vertex.size = vertex.size, main = main, vertex.label = id , vertex.label.dist = 1.3)
}

Try the tsnetwork package in your browser

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

tsnetwork documentation built on March 26, 2020, 6:45 p.m.