R-Help

 

For those of you who use igraph is there a way to highlight (color)
particular notes. For example if I want to color the "Peter" node red and
everything else blue  or leave default) how would I do that or can I do
that. Seems as though I might create an attribute column - maybe??

 

Jeff

 

library(igraph)

 

# define links in data

edges <- rbind(c("Dave", "Jenny"), c("Peter", "Jenny"), c("John", "Jenny"),
c("Dave", "Peter"), c("Dave", "John"), c("Peter", "Sam"), c("Sam",
"Albert"), c("Peter", "John"))

 

# generate and plot graph

# set argument directed = FALSE in graph.edgelist() to plot an undirected
graph.

g <- graph.edgelist(edges, directed = FALSE)

plot(g, vertex.size = 1, vertex.label.dist = 0.5)


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to