title: is it possible to redirect console output to a variable?
body: <p>In R, I'm wondering if it's possible to temporarily redirect the output of the console to a variable?</p>
  
  <p>p.s. There are a few examples on the web on how to use <code>sink()</code> to redirect the output into a filename, but none that I could find showing how to redirect into a variable.</p>
  
  <p>p.p.s. The reason this is useful, in practice, is that I need to print out a portion of the default console output from some of the built-in functions in R.</p>