library(igraph)
g <- make_empty_graph() +
vertices(letters[1:10]) +
vertices("foo", "bar", "bar2", "foobar2")
g <- g + edge("a", "b", color="red")
g <- g + edges("foo", "bar", "bar2", "foobar2", color="red", weight=1:2)
plot(g)
参考文献:《Network Analysis and Visualization》第11页