参考资料:
http://www.london2012.com/country/china/medals/index.html
http://en.wikipedia.org/wiki/2012_Summer_Olympics#Sports
整理后的数据文档
代码:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(treemap) | |
data <- read.csv('d:/olympic.csv',T) | |
tmPlot(data, | |
index=c("sports", "events"), | |
vSize="gold", | |
vColor="china", | |
type="value", | |
title='中国奥运金牌分布', | |
fontsize.labels=13, | |
lowerbound.cex.labels=0.7, | |
palette="-RdGy") |
没有评论:
发表评论