Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Plot of igraph: how to highlight a set of vertices

$
0
0

I am working with the igraph package in R to highlight a set of vertices. E.g. in

library(igraph)
actors <- data.frame(name=c("Alice", "Bob", "Cecil", "David",
                        "Esmeralda"))
relations <- data.frame(from=c("Bob", "Cecil", "Cecil", "David",
                           "David", "Esmeralda"),
                    to=c("Alice", "Bob", "Alice", "Alice", "Bob", "Alice"))
g <- graph_from_data_frame(relations, directed=TRUE, vertices=actors)
plot(g)

how can I highlight vertices Bob and David in the plot? In general, how can I highlight vertices that are enclosed in a vector?


Viewing all articles
Browse latest Browse all 201839

Trending Articles