title: How to print (to paper) a nicely-formatted data frame
body: <p>I'd like to print nicely-formatted data frames to paper, ideally from within a script. (I am trying to collect data using an instrument and automatically process and print it using an R script).</p>
  
  <p>Right now I can write a data frame to a text file using <code>write.table()</code>, but this has two problems:</p>
  
  <ol>
  <li>The resulting text file is poorly formatted (columns do not necessarily line up with their headings) and </li>
  <li>I don't know how to print a text file from within R.</li>
  </ol>
  
  <p>I'm looking more for general strategies than for specific code (although code would be great too!). Would Sweave be the most convenient solution? In principle can I use <code>socketConnection()</code> to print to a printer - and if so, where can I learn about how to use it (I didn't find the documentation to be very helpful).</p>