data.table 的 setkeyv 异常错误

Unusual error in setkeyv with data.table

我认为自己对data.table非常熟悉,但是在setkeyv函数中遇到了一个我无法解决的奇怪错误。

错误很直接:

keycols<-c("A", "B")
DT <- data.table(A=1:10, B=91:90)
setkeyv(DT, keycols)
# Error in setkeyv(x, cols, verbose = verbose, physical = physical) : 
#   4 arguments passed to .Internal(nchar) which requires 3

作为参考,这是我的 sessionInfo():

R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
[1] cvTools_0.3.2     robustbase_0.92-4 lattice_0.20-31   kernlab_0.9-20    rstan_2.6.0       inline_0.3.14     Rcpp_0.11.6       data.table_1.9.4 

loaded via a namespace (and not attached):
 [1] chron_2.3-47   grid_3.2.0     plyr_1.8.3     stats4_3.2.0   magrittr_1.5   stringi_0.5-4  reshape2_1.4.1 tools_3.2.0    stringr_1.0.0 
[10] DEoptimR_1.0-2

我无法解释为什么会这样,但升级到 R 3.2.1 并安装每个包的最新版本可以解决问题。作为参考,这是我更新后的sessionInfo()

R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
[1] kernlab_0.9-20    rstan_2.6.0       inline_0.3.14     Rcpp_0.11.6       cvTools_0.3.2     robustbase_0.92-4 lattice_0.20-31   data.table_1.9.4 

loaded via a namespace (and not attached):
 [1] chron_2.3-47   grid_3.2.1     plyr_1.8.3     stats4_3.2.1   magrittr_1.5   stringi_0.5-4  reshape2_1.4.1 tools_3.2.1    stringr_1.0.0 
[10] DEoptimR_1.0-2