title: Multiple binomial tests in one code
body: <p>I would like to perform the exact binomial test, with <code>binom</code> R package(<code>binom.test</code> function), to 4 different number of successes with 4 different probability values.</p>
  
  <p>I can do it singularly, but I would like to know if I can write a code to do the calculation in only one command (e.g. lapply, for loop).</p>
  
  <pre><code>x &lt;- c(68, 69, 70, 75)  #number of successes
  p &lt;- c(1/365, 2/365, 3/365, 4/365)  #probability of success
  n &lt;- 265 #number of trials
  </code></pre>
  
  <p>The <code>conf.level = 0.95</code> and <code>alternative = "two.sided"</code> (as the outcome can be as 1 or 0).</p>
  
  <p>Any suggestion?</p>
  
  <hr>
  
  <p>I tried:</p>
  
  <pre><code>for (i in 1:4) {
       test[i] &lt;- binom.test(x[i], n, p[i], alternative = "two.sided", conf.level = 0.95)
        }
  </code></pre>
  
  <p>but doesn't work.</p>