title: How to write from R to the clipboard on a mac
body: <p>I am trying to use the write.table function to write to my clipboard on a mac os system.  From other threads, I've tried</p>
  
  <pre><code>data &lt;- rbind(c(1,1,2,3), c(1,1, 3, 4), c(1,4,6,7))
  clip &lt;- pipe("pbcopy", "w")                       
  write.table(data, file="clip")                               
  close(clip)
  </code></pre>
  
  <p>This code does not give any error messages, but also does not copy anything to the clipboard.
      any suggestions?</p>