title: R: use min() within dplyr::mutate()
body: <pre><code>require(plyr)
  require(dplyr)    
  set.seed(8)
      df &lt;- 
        data.frame(
          v1 = runif(10, -1,1),
          v2 = runif(10, -1,1))
  </code></pre>
  
  <p>The problem:
  How can I get the correct values into the <code>min()</code> function as part of <code>mutate()</code>- basically, I would like to assign <code>v3</code>as <code>v1</code> divided with the smallest of <code>v1</code> and <code>v2</code>.
  This doesnt work: </p>
  
  <pre><code>  df &lt;- 
           df %&gt;% mutate(v3=ifelse(v1 !=0, v1/min(v1,v2), 0))
  </code></pre>
  
  <p>I guess I am missing something really simple.</p>