贸易流与igraph包在r

时间:2013-10-30 12:03:05

标签: r data-visualization igraph

我有200个特定商品国家的贸易数据(出口/进口)。例如:

b <- c("countryA", "countryB", "countryC", "countryA", "countryC", "countryA")
c <- c("countryB", "countryC", "countryA", "countryB", "countryA", "countryB")
d<- c(100, 200, 200, 300, 400, 200)
e <- c(5,12,10,24,25,12)
mydata <- data.frame(b,c,d,e)
colnames(mydata) <- c("exporteur", "partner", "tradeflow", "price")

我使用igraph包来显示交易流程。

library(igraph)
mydata.igraph <- graph.data.frame(mydata)
plot(mydata.igraph)

我的问题: 1.如何将价值和价格添加到每个“交易流程箭头”? 2.如何指定价值和价格的选项(字体大小,颜色等)?

提前致谢!

0 个答案:

没有答案