title: Read-write pipe() communication in R
body: <p>Most languages support two-way process communication.  For example, in Python, I can (sloppily) do:</p>
  
  <pre><code>&gt;&gt;&gt; from subprocess import *
  &gt;&gt;&gt; p = Popen('nslookup', stdin=PIPE, stdout=PIPE)
  &gt;&gt;&gt; p_stdin, p_stdout = p.communicate("www.google.com")
  &gt;&gt;&gt; print p_stdin
  Server:     ...
  </code></pre>
  
  <p>In R, I can only seem to go one way, regardless of whether I open my pipe with "r+" or "w+".   Furthermore, even if I run a script via <code>R -f ...</code> or <code>R &lt; ...</code>, weird behavior ensues in the actual console stdin/stdout.</p>
  
  <p>My question boils down to the following - is it possible (without writing a C method!) to reproduce the two-way process communication in the above Python example in R?  </p>