title: How to read whitespace delimited strings until EOF in R
body: <p>I am new to R and I am currently having trouble with reading a series of strings until I encounter an EOF. Not only I don't know how to detect EOF, but I also don't know how to read a single string separated by whitespace which is trivial to do in any other language I have seen so far. In C, I would simply do:</p>
  
  <pre><code>while (scanf("%s", s) == 1) { /* do something with s */ }
  </code></pre>
  
  <p>If possible, I would prefer a solution which does not require knowing the maximum length of strings in advance.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT: I am looking for solution which does not store all the input into memory, but the one equivalent or at least similar to the C code above.</p>