Talk:Ladle/Statistics

From Armagetron
< Talk:Ladle
Revision as of 03:39, 4 August 2013 by Newbie (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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),
       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),
       emmy=c(16,20,25,32,37,39,40,42),
       gonzap=c(20,32,37,39,40,42,53,71),
       b3er=c(25,32,37,39,40,42,53,71),
       mazuff=c(4,6,9,11,18,19,33,34),
       lacka=c(3,9,11,14,18,34,35,38,43,60,63,64),
       fofo=c(12,13,29,30,36,46,50,52,57,58),
       hoax=c(12,15,22,23,28,44,45,50,55,56),
       durka=c(8,10,14,17,22,28,44,45,61),
       xyron=c(21,24,27,32,33,37,39,40,42,50,55,56,61)
       ),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))
   ggplot(data) + geom_point(aes(x=ladle,y=reorder(p,ladle),size=c,colour=c),shape=9) + 
       scale_colour_gradient('wins', guide="legend", breaks=seq(from=1,to=max(data$c),length.out=5)) +
       scale_size_area('wins',breaks=seq(from=1,to=max(data$c),length.out=5)) + 
       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=(if (max(data$ladle)<72) 72 else max(data$ladle)),by=12)))