title: In R how can I select every nth column and every nth row within those columns?
body: <p>I have a large data set and I want to select every nth column and every nth row within that column.</p>
  
  <p>In this example if I want every 2nd column and every 2nd row I would get 9 and 11 for the first and 6 and 8 for the second.</p>
  
  <pre><code>x &lt;- data.frame("x1" = c(1:4), "y1" = c(8:11), "x2" = c(14:17), "y2" = c(5:8))
  x
  </code></pre>