我使用以下数据创建图形,
actors <- data.frame(name=c("Alice", "Bob", "Cecil",
"David","Esmeralda"),
age=c(48,33,45,34,21),
gender=c("F","M","F","M","F"))
relations <- data.frame(from= c("Bob", "Cecil", "Cecil", "David",
"David", "Esmeralda", "Alice"),
to= c("Alice", "Bob", "Alice", "Alice",
"Bob", "Alice", "Bob"),
same.dept= c( FALSE, FALSE, TRUE, FALSE,
FALSE, TRUE, FALSE),
friendship=c( 4, 5, 5, 2,
1, 1, 4),
advice= c( 4, 5, 5, 4,
2, 3, 4))
g <- graph.data.frame(relations, directed=TRUE, vertices=actors)
plot(g, layout=layout.kamada.kawai)
您可以看到顶点“Alice”和“Bob”在图形中具有双向性。
我只想看看哪些顶点是双向的?我怎样才能做到这一点?
非常感谢!