作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我认为自己非常熟悉 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/
我认为自己非常熟悉 data.table ,但是在setkeyv中遇到了一个奇怪的错误我无法解决的功能。 错误非常简单: keycols<-c("A", "B") DT <- data.table(A
我是一名优秀的程序员,十分优秀!