title: select submatrix in R
body: <p>I have a matrix called m as follows</p>
  
  <pre><code>&gt; m&lt;-matrix(1:15,3,5)
  &gt; m
       [,1] [,2] [,3] [,4] [,5]
  [1,]    1    4    7   10   13
  [2,]    2    5    8   11   14
  [3,]    3    6    9   12   15
  </code></pre>
  
  <p>I want to remove the first column of this matrix. Within a function I pass a value called <em>j</em>, which is always <em>1</em> less than the number of columns in <em>m</em> (In this example <em>j</em> is 4).
  Therefore I used the following code</p>
  
  <pre><code> &gt;m[,2:4+1]
       [,1] [,2] [,3]
  [1,]    7   10   13
  [2,]    8   11   14
  [3,]    9   12   15
  </code></pre>
  
  <p>But it is giving only the last 3 columns. Then I changed the code as follows</p>
  
  <pre><code> &gt;m[,2:(4+1)]
  </code></pre>
  
  <p>This time I had the correct output.
  Also it is giving the same output for following code as well</p>
  
  <pre><code>&gt; m[,1:4+1]
  </code></pre>
  
  <p><strong>Somebody please explain me how the following codes work?</strong> </p>
  
  <pre><code>&gt;m[,2:4+1]
  &gt;m[,1:4+1]
  </code></pre>