verbose <- TRUE
DT <- copy(GM.bak)

NOT_NEEDED_1 <- c("event_filename", "content_filename")
# "vendor_identifier", "vendor_offer_code", 

NOT_NEEDED_2 <- c("vendor_offer_code", "vendor_identifier", "download_date")


DT[, (NOT_NEEDED_1) := NULL]
DT[, (NOT_NEEDED_2) := NULL]


fixColTypes_(DT, idcol=.meta.iradio.event.idcols, POSIXct.milli=.meta.iradio.event.posixCols.mili, factor_list=.meta.iradio.event.factorlist, drop.these.columns=.meta.iradio.event.notUsing, verbose=verbose)


> DT
        event_type end_reason    event_start_time      event_end_time customer_identifier apple_identifier device_type track_ownership station_id storefront_name         artist
     1:     Played      Other 2014-02-10 14:32:39 2014-02-10 14:36:10              966178        771894709     Desktop       Not Owned  809521099              US The Glitch Mob
     2:     Played    Natural 2014-02-10 08:33:03 2014-02-10 08:37:33             1815798        771894811     Desktop       Not Owned  809521099              US The Glitch Mob
     3:     Played    Natural 2014-02-10 08:28:06 2014-02-10 08:33:03             1815798        771894809     Desktop       Not Owned  809521099              US The Glitch Mob
     4:     Played    Natural 2014-02-10 07:10:00 2014-02-10 07:15:16             1815798        771894710     Desktop       Not Owned  809521099              US The Glitch Mob
     5:     Played    Natural 2014-02-10 08:28:02 2014-02-10 08:28:06             1815798        771894805     Desktop       Not Owned  809521099              US The Glitch Mob
    ---                                                                                                                                                                         
963866:     Played    Natural 2014-02-07 02:57:27 2014-02-07 02:58:23         11000130678        771894715      Mobile       Not Owned  809521099              US The Glitch Mob
963867:     Played    Natural 2014-02-07 03:27:55 2014-02-07 03:33:44         11000130678        771894714      Mobile       Not Owned  809521099              US The Glitch Mob
963868:     Played    Natural 2014-02-07 03:18:20 2014-02-07 03:22:37         11000130678        771894709      Mobile       Not Owned  809521099              US The Glitch Mob

                                                     title     label         isrc extracted_upc_long extracted_upc extracted_isrc
     1:                                    Mind of a Beast Glass Air QMBZ91303405       888003700055  888003700055   QMBZ91303405
     2: Beauty of the Unhidden Heart (feat. Sister Crayon) Glass Air QMBZ91303414       888003700055  888003700055   QMBZ91303414
     3:                                      Carry the Sun Glass Air QMBZ91303413       888003700055  888003700055   QMBZ91303413
     4:                     Our Demons (feat. Aja Volkman) Glass Air QMBZ91303406       888003700055  888003700055   QMBZ91303406
     5:                 Fly By Night Only (feat. Yaarrohs) Glass Air QMBZ91303412       888003700055  888003700055   QMBZ91303412
    ---                                                                                                                          
963866:           Becoming Harmonious (feat. Metal Mother) Glass Air QMBZ91303408       888003700055  888003700055   QMBZ91303408
963867:                                          Skullclub Glass Air QMBZ91303407       888003700055  888003700055   QMBZ91303407
963868:                                    Mind of a Beast Glass Air QMBZ91303405       888003700055  888003700055   QMBZ91303405


.origin     <- as.Date("1970-01-01", format="%Y-%m-%d")
.origin.utc <- as.POSIXct("1970-01-01 00:00:00.000", format="%Y-%m-%d %H:%M:%S", tz="UTC")


.meta.iradio.event.factorlist <- list(
    'end_reason' = list(
          levels = 0:2
        , labels = c("Natural", "Skipped", "Other")
      )
    ,
    'event_type' = list(
          levels = 1:6
        , labels = c("Played", "2 (undefined)", "Liked", "Banned", "Wished", "Unwished")
      )
    , 
    'device_type' = list(
          levels = c("M", "D")
        , labels = c("Mobile", "Desktop")
      )
    ,
    'track_ownership' = list(
          levels = 0:4
        , labels = c("Not Applicable", "Not Owned", "Owned", "Owned & in Genius", "Owned & in Match")
      )
    
  )

.meta.iradio.event.posixCols.mili <- c("event_start_time", "event_end_time")
.meta.iradio.event.idcols   <- c("customer_identifier", "apple_identifier", "station_id", "storefront_name")
.meta.iradio.event.notUsing <- c("ingestion_time", "filename", "download_date")

## This is the statement to call when ready to clean 