Danny Malter

Data Science Manager - Accenture
M.S. in Predictive Analytics - DePaul University

Danny Malter

Me
Malter Analytics
GitHub
LinkedIn
YouTube Channel
Twitter
Kaggle

Other Work
General Assembly
AriBall

Media
Built In

NCAA Men’s BBall AP Top 10
library(ggvis)
library(dplyr)
ncaa <- paste("https://www.dropbox.com/s/pappjoov6ozvvf0/ncaa.csv?dl=0")
ncaa <- repmis::source_data(ncaa, sep = ",", header = TRUE)
ncaa$id <- 1:nrow(ncaa)

all_values <- function(x) {
  if(is.null(x)) return(NULL)
  
  paste0(ncaa$Team[x$id],            
         "<br>",
         ncaa$Record[x$id]
  )
}
ncaa  %>%
  ungroup() %>%
  ggvis(~Week,~Rank, stroke = ~Team) %>%
  layer_points(size := 40, size.hover := 200, fill = ~Team, key:=~id) %>%
  layer_lines(stroke.hover = ~Team, strokeWidth.hover := 8, strokeWidth := 1) %>%
  add_axis("x", orient = "top", ticks = 0, title = "NCAA Men's Basketball AP Top 10",
           properties = axis_props(
             axis = list(stroke = "white"),
             labels = list(fontSize = 0))) %>%
  add_axis("x", title="Week",  subdivide = 0, values = seq(1, 18, by = 1), format="####") %>%
  add_axis("y", title="Rank", subdivide = 0, values = seq(1, 10, by = 1), format='####') %>%
  scale_numeric("y", reverse=TRUE) %>%
  add_tooltip(all_values, "hover")

NCAA Men's Basketball AP Top 10123456789101112131415161718Week12345678910RankTeamArizonaDukeFloridaGonzagaIowa StateKansasKentuckyLouisvilleMarylandNorth CarolinaNorthern IowaNotre DameTexasUtahVillanovaVirginiaWichita StWisconsinTeamArizonaDukeFloridaGonzagaIowa StateKansasKentuckyLouisvilleMarylandNorth CarolinaNorthern IowaNotre DameTexasUtahVillanovaVirginiaWichita StWisconsin

comments powered by Disqus