title: Why isn't the R function sink() writing a summary output to my results file?
body: <p>Edit: This problem doesn't seem to be reproducible at this point, but I've updated this question to a more concise example that illustrates what the behavior was, in case anyone encounters a similar issue.</p>
  <pre><code>sink(&quot;res4.txt&quot;)
      cat(&quot;Here are my results:\n&quot;)
      summary(mtcars)
  sink()
  </code></pre>
  <p>The <code>sink(&quot;~/R/res4.txt&quot;)</code> function in the last line will store the <code>&quot;Here are my results&quot;</code> line, but not the <code>summary(res4)</code> line in the <code>.txt</code> file.</p>
  <p>Typing <code>summary(mtcars)</code> produces the correct data set, and I don't understand why the output of <code>summary(mtcars)</code> isn't included.</p>