[datatable-help] Puzzling issue
Matthew Dowle
mdowle at mdowle.plus.com
Mon Feb 28 09:20:09 CET 2011
Doesn't ring any bells. Will need a small reproducible example, or save
the object somewhere online so we can see it please.
Does sapply(test.dt,names) return any data, and if so seems like some
invalid data got in there depending on how it was created.
On Sun, 2011-02-27 at 18:09 -0600, Damian Betebenner wrote:
> 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
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
More information about the datatable-help
mailing list