![f:id:ryamada222222:20130721172223j:image f:id:ryamada222222:20130721172223j:image](https://cdn-ak.f.st-hatena.com/images/fotolife/r/ryamada222222/20130721/20130721172223.jpg)
library(igraph)
library (plyr)
make.v <- function(id=NULL,name="",type=NULL){
list(id=id,name=name,type=type)
}
shapes <- setdiff(vertex.shapes(), "")
g <- graph.empty()
Vs <- list()
Vs[[1]] <- make.v(1,"フラーレン",1)
Vs[[2]] <- make.v(2,"酔歩",2)
Vs[[3]] <- make.v(3,"3次元プロット",3)
Vs[[4]] <- make.v(4,"黄金比",1)
Vs[[5]] <- make.v(5,"グラフ理論",1)
Vs[[6]] <- make.v(6,"ウイルス",2)
Vs[[7]] <- make.v(7,"グラフ用パッケージ",3)
Vs[[8]] <- make.v(8,"正二十面体",1)
Vs.df <- ldply (Vs, data.frame)
g <- g + vertices(Vs.df$id)
e.list<-matrix(c(1,2,1,3,2,3,1,4,1,5,1,8,6,8,5,7),nrow=2)
g <- add.edges(g,e.list)
plot(g, vertex.shape=shapes[Vs.df$type], vertex.color = Vs.df$type,vertex.label=as.character(Vs.df$name),vertex.label.dist=1,vertex.size=15, vertex.size2=15)