title: Error in multiplication of two matrices in R language
body: <p>I created two matrices m and n using the method <code>matrix()</code> and wanted to display their multiplication result. But when I tried using <code>A*B</code> and <code>A%*%B</code>, all I got was the errors:</p>
  
  <blockquote>
    <p>Error in m * n : non-numeric argument to binary operator</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>Error in m %*% n : requires numeric/complex matrix/vector arguments.</p>
  </blockquote>
  
  <p>Here's the code where I checked if m and n are numerical matrices.</p>
  
  <pre><code>&gt; m
       [,1] [,2]
  [1,] 1    3   
  [2,] 2    4   
  &gt; n
       [,1] [,2]
  [1,] 5    7   
  [2,] 6    8   
  &gt; is.matrix(m)
  [1] TRUE
  &gt; is.matrix(n)
  [1] TRUE
  &gt; str(m)
  List of 4
   $ : num 1
   $ : num 2
   $ : num 3
   $ : num 4
   - attr(*, "dim")= int [1:2] 2 2
  &gt; str(n)
  List of 4
   $ : num 5
   $ : num 6
   $ : num 7
   $ : num 8
   - attr(*, "dim")= int [1:2] 2 2
  &gt; m*n
  Error in m * n : non-numeric argument to binary operator
  &gt; m%*%n
  Error in m %*% n : requires numeric/complex matrix/vector arguments
  &gt; 
  </code></pre>
  
  <p>I don't understand where's the problem. Any idea please?</p>