title: How to find the maximum value within a loop in R
body: <p>I have an expression</p>
  
  <pre><code> qbinom(0.05, n, .47) - 1 
  </code></pre>
  
  <p>and I want to create a loop which iterates this expression over n for n = (20,200). For each iteration of this loop, this function will produce a number. I want to take the maximum of the 180 numbers it will produce. So, something like.</p>
  
  <pre><code> for (n in 20:200) {
     max(qbinom(0.05, n, .47)-1)
  </code></pre>
  
  <p>But I'm not sure how exactly to do this.</p>
  
  <p>Thanks!</p>