gpt4 book ai didi

r - 使用 data.table 在 setkeyv 中出现异常错误

转载 作者:行者123 更新时间:2023-12-04 11:50:42 30 4
gpt4 key购买 nike

我认为自己非常熟悉 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

关于r - 使用 data.table 在 setkeyv 中出现异常错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31142280/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com