我正在使用 Windows 电脑尝试加快 read.table 步骤。我的文件都是 .gz 格式。
x=paste("gzip -c ",filename,sep="")
phi_raw = fread(x)
Error in fread(x) :
对于我来说,这个错误有点过于难懂了。
与zx8754所建议的不同:在特定的fread上下文中使用。虽然fread没有原生支持gzip,但这种模式应该是可行的。请参见http://www.molpopgen.org/coding/datatable.html
更新
根据下面的建议,使用system会产生更长的错误消息-但我仍然被卡住了。
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(system(x))
怎么样? - zx8754