# heat plot.r 


"------------------------------------------------------------------------"
## I am not sure why these were added.  Something to do with an unclear merge
.s_names <- grep("\\.s$", names(DB.sample), value=TRUE)
setnames(DB.sample, .s_names, gsub("\\.s$", "", .s_names))
"------------------------------------------------------------------------"




library(ggplot2)
source(as.path(srcDir, "supportFiles", "ggHeatGrid.r"))

if (FALSE) {

  ## This is an example of the params needed for ggHeatGrid
  ##    and the resulting DT that will be used

  timeCol <- "dl_time"
  wdayCol <- "dl_wday"
  ydayCol <- "dl_yday"
  hourCol <- "dl_hour"
  byCol <- c("upc", "genre", "artist_country", "user_country")
  countWhat <- "userid"
  DT <- copy(DB.raw[, .SD, .SDcols=c(timeCol, wdayCol, ydayCol, hourCol, byCol, countWhat)])
# eg: 
     DT[, list(value=.N), by=c(wdayCol, hourCol)]
}






#         |     
#    mid  |        
#         |     
#    6am  |         
#         |     
#    12pm |         
#         |     
#    6pm  |         
#         |     
#         |     
#   ------|------------------------------------ #
#         |   We   Th   Fr   Sa   Su   Mo   Tu




