[datatable-help] CJ behavior in 1.7.5

Damian Betebenner dbetebenner at nciea.org
Mon Dec 5 09:58:02 CET 2011


Just to confirm. The CJ behavior I reported is throwing errors in the development build as well as the CRAN release.

> library(data.table)
data.table 1.7.5  For help type: help("data.table")
> Y <- factor(1:2, levels=1:2, labels=c("MATHEMATICS", "READING"))
> Z <- factor(1:3, levels=1:3, labels=paste(2008:2010, 2009:2011, sep="_"))
> tmp.cj <- CJ(Y,Z)
> as.data.frame(tmp.cj)
           V1        V2
1 MATHEMATICS 2008_2009
2 MATHEMATICS 2009_2010
3 MATHEMATICS 2010_2011
4     READING      <NA>
5     READING      <NA>
6     READING      <NA>
Warning message:
In format.data.frame(x, digits = digits, na.encode = FALSE) :
  corrupt data frame: columns will be truncated or padded with NAs



This error doesn't occur when one feeds a character vector instead of a factor into CJ.

Damian


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20111205/72570ce0/attachment-0001.htm>


More information about the datatable-help mailing list