title: Check if default output goes to a terminal in R
body: <p>How can I check if output goes to a terminal in R?</p>
  
  <p>I found <code>file.info()</code> but as far as a file type is concerned, it seems to only support</p>
  
  <pre><code>isdir: logical: Is the file a directory?
  </code></pre>
  
  <p>and it doesn't seem to support arguments like <code>stdout()</code> or <code>stderr()</code>.</p>