title: Divide Matrix for an input pair
body: <pre><code> n=c(0,200,500)
   m=as.matrix(expand.grid( n,n)) 
   m #possible combin.
  </code></pre>
  
  <p>I want to get all possible pairs (a &lt; b) to run them later in a function to filter a matrix.</p>
  
  <pre><code>#pairs should be somehow like this (a always smaller than b in each single attribute of the two attribute vector)
  a=c(0,0)
  b=c(200,200)
  ...
  a=(200,0)
  b=(500,200)
  ...
  a=c(200,200)
  b=c(500,500)
  </code></pre>
  
  <p>I want to get the results stored in a matrix with i.e. one row of it looking like:     c(a, b)
        c(0,200,    200,500)</p>
  
  <p>On <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/lower.tri.html" rel="nofollow">lower.tri</a> there was something written about how to divide a matrix, I tried around but without success.</p>
  
  <p>For better understanding imagine each row of the possible combinations is a vector. First element of the vector is flight time in minutes. Second one is the price.
  Searching for a flight with a price between $500 and $500 doesn't make too much sense. Neither does it, when the flights minimum price is 500$ and the maximum price 200$. "a" is always minimum parameter and "b" maximum parameter</p>