title: Multiply each column of a data frame by the corresponding value of a vector
body: <p>I have the following data frame and vector:</p>
  
  <pre><code>dframe &lt;- as.data.frame(matrix(1:9,3))
  vector &lt;- c(2,3,4)
  </code></pre>
  
  <p>I would like to multiply each column of <code>dframe</code> by the corresponding value of <code>vector</code>. This won't do: </p>
  
  <pre><code>&gt; vector * dframe
    V1 V2 V3
  1  2  8 14
  2  6 15 24
  3 12 24 36 
  </code></pre>
  
  <p>each <strong>row</strong> of <code>dframe</code> is multiplied by the corresponding value of <code>vector</code>, not each <strong>column</strong>. Is there any idiomatic solution, or am I stuck with a <code>for</code> cycle?</p>