Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unusual error in setkeyv with data.table

Tags:

r

data.table

I'd consdier myself very familiar with data.table, but have encountered a strange error in the setkeyv function that I can't sort out.

The error is very straightforward:

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

For reference, this is my 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
like image 540
Sycorax Avatar asked Jun 30 '15 15:06

Sycorax


1 Answers

I have no explanation for why this is the case, but upgrading to R 3.2.1 and installing the latest version of every package resolves the issue. For reference, this is my sessionInfo() after updating:

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
like image 179
Sycorax Avatar answered Sep 18 '22 00:09

Sycorax