title: How can I use fread to read gz files in R?
body: <p>I am on a windows machine trying to speed up the read.table step. My files are all .gz.</p>
  
  <pre><code>x=paste("gzip -c ",filename,sep="")
  phi_raw = fread(x)
  
  Error in fread(x) : 
  </code></pre>
  
  <p>Cannot understand the error . Its a bit too cryptic for me.</p>
  
  <p>Not a duplicate as suggested by zx8754:  using specifically in the context of fread. And while fread dows not have native support for gzip, this paradigm should work.  See <a href="http://www.molpopgen.org/coding/datatable.html" rel="noreferrer">http://www.molpopgen.org/coding/datatable.html</a></p>
  
  <p><strong>Update</strong></p>
  
  <p>Per suggestion below using system yields a longer error message - though i am still stuck.</p>
  
  <pre><code>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
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>Running with gunzip as pointed out below:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>note the different status</p>