如何改变igraph中节点的外观?

Kar*_* W. 2 r igraph

我想用两种类型的节点布置图(树):盒子和圆圈.

这可能与igraph有关,最小的例子怎么样?

xie*_*hao 5

library(igraph)
g <- graph.empty()
g <- add.vertices(g, 4, 
    label=c('a', 'b', 'c', 'd'), 
    shape=c('rectangle', 'rectangle', 'circle', 'circle'))
g <- add.edges(g, c(1, 2, 2, 3))
plot(g)
Run Code Online (Sandbox Code Playgroud)