[datatable-help] Puzzling issue

Damian Betebenner dbetebenner at nciea.org
Mon Feb 28 01:09:35 CET 2011


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





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20110227/8537b52d/attachment.htm>


More information about the datatable-help mailing list