我希望这棵树从左到右而不是从上到下:
library(igraph)
igraph.options(plot.layout= layout.reingold.tilford)
m<-graph(c(1,2,1,3,2,4,2,5))
prob<-c("w=.6", .4, .8, .2)
plot(m,vertex.size=30,edge.arrow.size=0.2, vertex.label.color="black", vertex.label.dist=0 ,edge.label=prob, main="Tree")