Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This was previously <a href="http://markmail.org/message/zeew2gr2x77cglcv#query:r-project%20quickly%20read%20large%20file+page:1+mid:bovcytjhdkzmefru+state:results" rel="noreferrer">asked on <b>R-Help</b></a>, so that's worth reviewing.</p> <p>One suggestion there was to use <code>readChar()</code> and then do string manipulation on the result with <code>strsplit()</code> and <code>substr()</code>. You can see the logic involved in readChar is much less than read.table.</p> <p>I don't know if memory is an issue here, but you might also <a href="http://cran.r-project.org/web/packages/HadoopStreaming/index.html" rel="noreferrer">want to take a look at the <b>HadoopStreaming</b> package</a>. This <a href="http://en.wikipedia.org/wiki/Hadoop" rel="noreferrer">uses Hadoop</a>, which is a MapReduce framework designed for dealing with large data sets. For this, you would use the hsTableReader function. This is an example (but it has a learning curve to learn Hadoop):</p> <pre><code>str &lt;- "key1\t3.9\nkey1\t8.9\nkey1\t1.2\nkey1\t3.9\nkey1\t8.9\nkey1\t1.2\nkey2\t9.9\nkey2\" cat(str) cols = list(key='',val=0) con &lt;- textConnection(str, open = "r") hsTableReader(con,cols,chunkSize=6,FUN=print,ignoreKey=TRUE) close(con) </code></pre> <p>The basic idea here is to break the data import into chunks. You could even go so far as to use one of the parallel frameworks (e.g. snow) and run the data import in parallel by segmenting the file, but most likely for large data sets that won't help since you will run into memory constraints, which is why map-reduce is a better approach.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload