title: How to find difference between 2 columns in R of a vector?
body: <p>I have the following vector in R</p>
  <pre><code>x &lt;-seq(1, 10, by=1)    
  p &lt;-permutations(10, 3, c(x), repeats.allowed=FALSE)
  </code></pre>
  <p>I would like to list all the rows that have difference between first and last column less than 3. How can I achieve this in R?</p>
  <p>I know that I can get the first and third column using this but i dont know after that:</p>
  <pre><code>p[, c(1,3)]
  </code></pre>
  <p>Thank you for any direction</p>