title: How can I create an infix %between% operator?
body: <p>I would like to have an infix operator <code>%between%</code> in <code>R</code> -- to check to see if <code>x</code> is between lower bound <code>l</code> and upper bound <code>u</code>.  </p>
  
  <p>I have created the following simple function -- but it's not an infix operation. </p>
  
  <pre><code># between function - check to see if x is between l and u
  is.between &lt;- function(x, l, u) { x &gt; l &amp; x &lt; u }
  </code></pre>
  
  <p>My aim is to replace this with: <code>x %between% c(l, u)</code></p>
  
  <p>Is it possible to define new infix operations? If so, how does one do this?</p>
  
  <p>thanks in advance</p>