R data.table v1.9.6中的错误 - 函数“fread” [英] Error in R data.table v1.9.6 - function "fread"

查看:615
本文介绍了R data.table v1.9.6中的错误 - 函数“fread”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新到data.table 1.9.6,并使用 fread 时收到以下错误:

I recently updated to data.table 1.9.6 and get the following error when using fread:

 fread("Aug14.csv")
Error in fread("Aug14.csv") : 
  4 arguments passed to .Internal(nchar) which requires 3

另一篇文章在另一个上下文中讨论了这个错误,但是在升级到data.table 1.9.6之前, 。任何建议?

Another post discusses this error in another context, but this worked fine prior to upgrading to data.table 1.9.6. Any advice?

这是我的设置:

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] data.table_1.9.6 Matrix_1.2-2    

loaded via a namespace (and not attached):
[1] modeltools_0.2-21 tools_3.2.0       splines_3.2.0     grid_3.2.0        chron_2.3-47      stats4_3.2.0      lattice_0.20-33  


推荐答案

是影响其他软件包的更广泛的问题,并且在r-devel上提出了类似的问题:

This seems to be a wider problem affecting other packages too and something similar was raised on r-devel here :

http://r.789695.n4.nabble.com/Error-generated-by-Internal-nchar-disappears -when-debugging-td4713138.html

如果我理解正确,CRAN为R 3.2。*系列提供一个Windows二进制文件。我想这个二进制是使用最新版本的R在该系列,目前R 3.2.2。正如Andriy T.在此处的评论中指出, base R函数 nchar 在R 3.2.1中获得了一个额外的参数。因为data.table使用R函数 nchar ,并且在它的DESCRIPTION文件中设置了 ByteCompile:TRUE ,CRAN二进制包对于Windows似乎不兼容R 3.2.0。我猜对于R本身的二进制不兼容的更改应该是做到.0版本只是为了这个原因,但我不确定。在安装时编译软件包(例如Ubuntu)这不是问题。

If I understand correctly, CRAN provides one Windows binary for the R 3.2.* series. I guess this binary is built using the latest version of R in that series, currently R 3.2.2. As Andriy T. pointed out in a comment here, the base R function nchar gained an extra argument in R 3.2.1. Since data.table uses the R function nchar and it sets ByteCompile:TRUE in its DESCRIPTION file, the CRAN binary package for Windows doesn't seem to be compatible with R 3.2.0. I guess binary incompatible changes to R itself are supposed to be made to the .0 version only for this reason, but I'm not sure on that. Where packages are compiled on install (e.g. Ubuntu) this isn't an issue.

如果你使用R& 3.2.0在任何平台上,都不应该有问题。

If you are using R < 3.2.0 on any platform, there shouldn't be a problem.

如果你在任何平台上使用R> = 3.2.1,

If you are using R >= 3.2.1 on any platform, there shouldn't be a problem.

如果您在Windows上使用R 3.2.0并从CRAN安装二进制.zip(即默认方法),那么您需要升级到R> = 3.2.1或者,build data.table(以及可能的任何其他使用 nchar 的包,也设置 ByteCompile:TRUE )您自己使用 Rtools

If you are using R 3.2.0 on Windows and installing the binary .zip from CRAN (i.e. the default method) then you'll need to either upgrade to R >= 3.2.1, or, build data.table (and potentially any other package using nchar that also set ByteCompile:TRUE) yourself using Rtools.

这篇关于R data.table v1.9.6中的错误 - 函数“fread”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆