title: Multiply a data frame row-by-row
body: <p>Input file:</p>
  
  <pre><code>df1 &lt;- data.frame(row.names=c("w","x","y","z"), 
                    A=c(0,0,0,0),
                    B=c(0,1,0,0), 
                    C=c(1,0,1,0), 
                    D=c(1,1,1,1))
  
    A B C D
  w 0 0 1 1
  x 0 1 0 1
  y 0 0 1 1
  z 0 0 0 1
  </code></pre>
  
  <p>I want to apply an equation i.e. multiply row w to row x to get the pairwise value for w-x pair, as follows:</p>
  
  <pre><code>      A B C D
      w 0 0 1 1
  X   x 0 1 0 1
  --------------
     wx 0 0 0 1
  </code></pre>
  
  <p>to get row-wise analysis for w-x, w-y, w-y, w-z, x-y, x-z, y-z. and generate a new dataframe with 6 columns (two row names followed by the multiplied values).</p>
  
  <p>That's </p>
  
  <pre><code>w x 0 0 0 1
  w y 0 0 1 1
  w z 0 0 0 1
  x y 0 0 0 1
  x z 0 0 0 1
  y z 0 0 0 1
  </code></pre>
  
  <p>Thanks.</p>