title: Matrix and vector multiplication operation in R
body: <p>I feel matrix operations in R is very confusing: we are mixing row and column vectors.</p>
  
  <ul>
  <li><p>Here we define <code>x1</code> as a vector, (I assume R default vector is a column vector? but it does not show it is arranged in that way.)</p></li>
  <li><p>Then we define <code>x2</code> is a transpose of <code>x1</code>, which the display also seems strange for me.</p></li>
  <li><p>Finally, if we define <code>x3</code> as a matrix the display seems better.</p></li>
  </ul>
  
  <p>Now, my question is that, <code>x1</code> and <code>x2</code> are completely different things (one is transpose of another), but we have the same results here. </p>
  
  <p>Any explanations? may be I should not mix vector and matrix operations together?</p>
  
  <pre><code>x1 = c(1:3)
  x2 = t(x1)
  x3 = matrix(c(1:3), ncol = 1)
  
  x1
  [1] 1 2 3
  
  x2
       [,1] [,2] [,3]
  [1,]    1    2    3
  
  x3
       [,1]
  [1,]    1
  [2,]    2
  [3,]    3
  
  x3 %*% x1
       [,1] [,2] [,3]
  [1,]    1    2    3
  [2,]    2    4    6
  [3,]    3    6    9
  
  x3 %*% x2
       [,1] [,2] [,3]
  [1,]    1    2    3
  [2,]    2    4    6
  [3,]    3    6    9
  </code></pre>