title: Calling prop.test function in R with dplyr
body: <p>I am trying to calculate several binomial proportion confidence intervals. My data are in a data frame, and though I can successfully extract the <code>estimate</code> from the object returned by <code>prop.test</code>, the <code>conf.int</code> variable seems to be null when run on the data frame.</p>
  
  <pre><code>library(dplyr)
  
  cases &lt;- c(50000, 1000, 10, 2343242)
  population &lt;- c(100000000, 500000000, 100000, 200000000)
  
  df &lt;- as.data.frame(cbind(cases, population))
  df %&gt;% mutate(rate = prop.test(cases, population, conf.level=0.95)$estimate)
  </code></pre>
  
  <p>This appropriately returns</p>
  
  <pre><code>    cases population       rate
  1   50000      1e+08 0.00050000
  2    1000      5e+08 0.00000200
  3      10      1e+05 0.00010000
  4 2343242      2e+08 0.01171621
  </code></pre>
  
  <p>However, when I run</p>
  
  <pre><code>df %&gt;% mutate(confint.lower= prop.test(cases, pop, conf.level=0.95)$conf.int[1])
  </code></pre>
  
  <p>I sadly get</p>
  
  <pre><code>Error in mutate_impl(.data, dots) : 
    Column `confint.lower` is of unsupported type NULL
  </code></pre>
  
  <p>Any thoughts? I know alternative ways to calculate the binomial proportion confidence interval, but I would really like to learn how to use <code>dplyr</code> well.</p>
  
  <p>Thank you!</p>