title: ending for loop if condition is met
body: <p>How can I end a for loop if a condition is met inside it?</p>
  
  <p>I want to break a for loop once t = 1 for example, but as of now I am only breaking out of an if statement inside the for loop. </p>
  
  <pre><code>t = 0
  x = matrix()
  for (i in 1:10){
     if (t == 1){
         break }
     t = t + 0.01
     x[i] = t
  }
  </code></pre>