[R] Graph in R with edge weights
papucho at me.com
Wed Dec 1 19:19:18 CET 2010
I was asking the same thing and came across the following (your need the "sna" library).
Take a look at the edge.lwd and vertex.cex examples of the function gplot. You can use vectors for the different nodes.
On Dec 1, 2010, at 9:31 AM, arturs.onzuls at gmail.com wrote:
> Can you please show code example, how to draw graph with some nodes and
> edges, but with weights. I only found here
> Using edge weights for labels, but...
> Here an example:
>> library("graph"); library(Rgraphviz)
>> myNodes = c("s", "p", "q", "r")
>> myEdges = list(
> s = list(edges = c("p", "q")),
> p = list(edges = c("p", "q")),
> q = list(edges = c("p", "r")),
> r = list(edges = c("s")))
>> g = new("graphNEL", nodes = myNodes,
> edgeL = myEdges, edgemode =
> but how about weights?
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help