【发布时间】:2016-10-10 05:15:19
【问题描述】:
我在试图加快 read.table 步骤的 Windows 机器上。我的文件都是.gz。
x=paste("gzip -c ",filename,sep="")
phi_raw = fread(x)
Error in fread(x) :
无法理解错误。对我来说有点太神秘了。
不是 zx8754 建议的重复:专门在 fread 的上下文中使用。虽然 fread dows 没有对 gzip 的原生支持,但这种范例应该可以工作。见http://www.molpopgen.org/coding/datatable.html
更新
以下使用系统的建议会产生更长的错误消息 - 尽管我仍然卡住。
Error in fread(system(x)) :
'input' must be a single character string containing a file name, a command, full path to a file, a URL starting 'http[s]://', 'ftp[s]://' or 'file://', or the input data itself
In addition: Warning message:
running command 'gzip -c D:/x_.gz' had status 1
更新
如下所示使用 gunzip 运行:
Error in fread(system(x)) :
'input' must be a single character string containing a file name, a command, full path to a file, a URL starting 'http[s]://', 'ftp[s]://' or 'file://', or the input data itself
In addition: Warning message:
running command 'gunzip -c D:/XX_.gz' had status 127
注意不同的状态
【问题讨论】:
-
不是重复的:专门在 fread 的上下文中使用。虽然 fread dows 没有对 gzip 的原生支持,但这种范例应该可以工作。
-
错误信息在哪里?
fread(system(x))怎么样? -
我们确定您安装的 Windoze 可以访问 gzip 和 gunzip 吗?还要注意引用的文章使用的是 gunzip 而不是 gzip。