title: format a time difference automatically
body: <p>Inside a function a need to convert some number, in general in range of 20 to 200, in to <code>difftime</code> and show via <code>format</code> as expected time needed to finish.</p>
  
  <p><code>as.difftime</code> has got a useful <code>units="auto"</code> so it will use "sec" say for 20 secs and "mins" for 60+ secs...</p>
  
  <p>But it says also</p>
  
  <pre><code>&gt; as.difftime(100, units="auto")
  Error in as.difftime(100, units = "auto") : 
    need explicit units for numeric conversion
  </code></pre>
  
  <p>How can I avoid that?</p>
  
  <p>EDIT: Current workaround</p>
  
  <pre><code>&gt; (Sys.time()+100)-Sys.time()
  Time difference of 1.666667 mins
  </code></pre>