title: Using 'prod' for a lot of numbers
body: <p>I want to simplify my code. df is a dataframe consisting of 7 variables and I want the product of them.</p>
  <pre><code>df &lt;- data.frame(0.5, 5, 9.8, 10.3, 5.7, 0.9, 19.0)
  &gt; prod(df[1], df[2], df[3], df[4], df[5], df[6], df[7])
  [1] 24596.55
  </code></pre>
  <p>It is a lot of work if you've got more dataframes so I want a simple code to do this.</p>
  <p>I thought something like this:</p>
  <pre><code>for(i in 1:7){
    product = prod(df[i])
  }
  &gt; product
  [1] 19
  </code></pre>
  <p>But that's not what I want. Can somebody help me with this problem?</p>