title: Creating a multiplication matrix from data frame
body: <p>I have this matrix  </p>
  
  <pre><code>m&lt;- matrix(c(0:13),nrow=2,ncol=7)
  colnames(m)&lt;-c("0","1","2","3","4","5","6")
  rownames(m)&lt;-c("A","B")
  
  
    0 1 2 3 4  5  6
  A 0 2 4 6 8 10 12
  B 1 3 5 7 9 11 13
  </code></pre>
  
  <p>and I want to multiply each observation in row one by each observation in row two. So I would have something that looks like this</p>
  
  <pre><code>   0  1  2  3  4  5  6
  0 NA NA NA NA NA NA NA
  1 NA NA NA NA NA NA NA
  2 NA NA NA NA NA NA NA
  3 NA NA NA NA NA NA NA
  4 NA NA NA NA NA NA NA
  5 NA NA NA NA NA NA NA
  6 NA NA NA NA NA NA NA
  </code></pre>