All,

Running some simple data.table code that previously ran and now getting errors 
that I don't understand and a found a work around that is puzzling:

Doesn't run:

tmp <- tmp.dt[, sum(!is.na(SGP)), by=list(STATE, CONTENT_AREA)]
Error in `[.data.table`(tmp.dt, , sum(!is.na(SGP)), by = list(STATE, 
CONTENT_AREA)) :
  'names' attribute [215514] must be the same length as the vector [215227]

Does run:

tmp <- tmp.dt[, sum(!is.na(as.numeric(SGP))), by=list(STATE, CONTENT_AREA)]

class(tmp.dt$SGP)
[1] "integer"


Hmmm. Not sure what's going on.

Damian





_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to