title: Sequence construction that creates an empty sequence if lower is greater than upper bound
body: <p>More than once the "cleverness" of R's <code>seq</code> function has hit me badly in the corner case when <code>lower == upper - 1</code>:</p>
  
  <pre><code>&gt; 1:0
  [1] 1 0
  &gt; seq(1, 0)
  [1] 1 0
  &gt; seq(1, 0, 1)
  Error in seq.default(1, 0, 1) : wrong sign in 'by' argument
  </code></pre>
  
  <p>I'm not asking for the reasons of this odd behavior -- I assume it's now just a legacy that we have to live with. Instead, I'd like to know if any package implements a <code>seq</code> operator that returns an empty sequence in this case, like the following:</p>
  
  <pre><code>safe.seq.int &lt;- function(from, to, by=1) {
    if (from &gt; to) integer(0) else seq.int(from, to, by)
  }
  
  &gt; safe.seq.int(1, 0)
  integer(0)
  </code></pre>