Difference between revisions of "Talk:Ladle/Statistics"
From Armagetron
(Created page with "http://wiki.armagetronad.org/index.php/Ladle/Statistics#Individual_stats Script to generate plot (use http://www.rstudio.com/) require(ggplot2) require(scales) li...") |
|||
Line 2: | Line 2: | ||
Script to generate plot (use http://www.rstudio.com/) | Script to generate plot (use http://www.rstudio.com/) | ||
+ | |||
require(ggplot2) | require(ggplot2) | ||
require(scales) | require(scales) | ||
list <- sapply(list( | list <- sapply(list( | ||
− | + | newb=c(1,4,6,9,11,21,24,33,34,35), | |
− | + | dlh=c(6,9,18,19,33,34,35,55,56,61), | |
− | + | dread=c(22,37,39,42,48,51,54,55,56,61,65,66,69,73,74), | |
− | + | titan=c(33,38,43,46,60,63,70), | |
− | + | eckz=c(41,49,51,54,57,58,59,62,65,66), | |
− | + | flex=c(12,13,15,18,19,26,29,30,31,36,50,52), | |
− | + | woned=c(16,20,25,32,37,39,40,42,53,71,72), | |
− | + | emmy=c(16,20,25,32,37,39,40,42), | |
− | + | gonzap=c(20,32,37,39,40,42,53,71,72), | |
− | + | b3er=c(25,32,37,39,40,42,53,71,72), | |
− | + | mazuff=c(4,6,9,11,18,19,33,34,48), | |
− | + | lacka=c(3,9,11,14,18,34,35,38,43,60,63,64), | |
− | + | fofo=c(12,13,15,27,29,30,31,36,46,48,50,52,57,58,75), | |
− | + | hoax=c(12,13,15,22,23,28,44,45,50,55,56,61,75), | |
− | + | durka=c(8,10,14,17,22,23,28,44,45,61), | |
− | + | xyron=c(21,24,27,32,33,37,39,40,42,50,55,56,61), | |
+ | viper=c(7,24,27,29,30,31,36,46) | ||
),sort) | ),sort) | ||
data <- data.frame(p=rep(paste(names(list)," (",sapply(list,length),")",sep=""),times=sapply(list,length)), | data <- data.frame(p=rep(paste(names(list)," (",sapply(list,length),")",sep=""),times=sapply(list,length)), | ||
ladle=unlist(list,use.names=F), | ladle=unlist(list,use.names=F), | ||
c=unlist(sapply(list,function(x)(1:length(x))),use.names=F)) | c=unlist(sapply(list,function(x)(1:length(x))),use.names=F)) | ||
+ | bre <- unique(c(seq(from=1,to=max(data$c),by=5),max(data$c))) | ||
ggplot(data) + geom_point(aes(x=ladle,y=reorder(p,ladle),size=c,colour=c),shape=9) + | ggplot(data) + geom_point(aes(x=ladle,y=reorder(p,ladle),size=c,colour=c),shape=9) + | ||
− | scale_colour_gradient('wins', guide="legend", breaks= | + | scale_colour_gradient('wins', guide="legend", breaks=bre) + |
− | scale_size_area('wins',breaks= | + | scale_size_area('wins',breaks=bre) + |
theme(axis.title.y=element_blank(),panel.grid.minor=element_blank(),axis.ticks.x=element_blank(),axis.ticks.y=element_blank()) + | theme(axis.title.y=element_blank(),panel.grid.minor=element_blank(),axis.ticks.x=element_blank(),axis.ticks.y=element_blank()) + | ||
− | scale_x_continuous(breaks=c(1,seq(from=12,to= | + | scale_x_continuous(breaks=c(1,seq(from=12,to=max(data$ladle),by=12))) |
Revision as of 05:29, 9 November 2013
http://wiki.armagetronad.org/index.php/Ladle/Statistics#Individual_stats
Script to generate plot (use http://www.rstudio.com/)
require(ggplot2) require(scales) list <- sapply(list( newb=c(1,4,6,9,11,21,24,33,34,35), dlh=c(6,9,18,19,33,34,35,55,56,61), dread=c(22,37,39,42,48,51,54,55,56,61,65,66,69,73,74), titan=c(33,38,43,46,60,63,70), eckz=c(41,49,51,54,57,58,59,62,65,66), flex=c(12,13,15,18,19,26,29,30,31,36,50,52), woned=c(16,20,25,32,37,39,40,42,53,71,72), emmy=c(16,20,25,32,37,39,40,42), gonzap=c(20,32,37,39,40,42,53,71,72), b3er=c(25,32,37,39,40,42,53,71,72), mazuff=c(4,6,9,11,18,19,33,34,48), lacka=c(3,9,11,14,18,34,35,38,43,60,63,64), fofo=c(12,13,15,27,29,30,31,36,46,48,50,52,57,58,75), hoax=c(12,13,15,22,23,28,44,45,50,55,56,61,75), durka=c(8,10,14,17,22,23,28,44,45,61), xyron=c(21,24,27,32,33,37,39,40,42,50,55,56,61), viper=c(7,24,27,29,30,31,36,46) ),sort) data <- data.frame(p=rep(paste(names(list)," (",sapply(list,length),")",sep=""),times=sapply(list,length)), ladle=unlist(list,use.names=F), c=unlist(sapply(list,function(x)(1:length(x))),use.names=F)) bre <- unique(c(seq(from=1,to=max(data$c),by=5),max(data$c))) ggplot(data) + geom_point(aes(x=ladle,y=reorder(p,ladle),size=c,colour=c),shape=9) + scale_colour_gradient('wins', guide="legend", breaks=bre) + scale_size_area('wins',breaks=bre) + theme(axis.title.y=element_blank(),panel.grid.minor=element_blank(),axis.ticks.x=element_blank(),axis.ticks.y=element_blank()) + scale_x_continuous(breaks=c(1,seq(from=12,to=max(data$ladle),by=12)))