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

查看:14
本文介绍了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. 在这里的评论中指出的那样,基本 R 函数 nchar 在 R 3.2.1 中获得了一个额外的参数.由于 data.table 使用 R 函数 nchar 并在其说明文件中设置 ByteCompile:TRUE,Windows 的 CRAN 二进制包似乎与 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,或者构建 data.table (并且可能使用 nchar 的任何其他包也使用 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天全站免登陆