由于不允许负长度向量,因此熔化data.table会产生错误

时间:2019-06-29 10:41:41

标签: r data.table

我正在尝试合并一个大的data.table,但是由于错误而失败

Error in melt.data.table(DT, as.character(1:14), as.character(15:1000)) : 
  negative length vectors are not allowed

下面是一个示例-

library(data.table)
DT = as.data.table(matrix('99', 2761279, 1000)); colnames(DT) = as.character(1:1000)
DT1 = melt(DT, as.character(1:14), as.character(15:1000))

此问题是否有任何解决方法。以下是我的系统信息

> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.6 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
 [1] LC_CTYPE=C                 LC_NUMERIC=C              
 [3] LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8    
 [5] LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8   
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] data.table_1.12.2

loaded via a namespace (and not attached):
[1] compiler_3.4.4

0 个答案:

没有答案