How can I end a for loop if a condition is met inside it?
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.
t = 0
x = matrix()
for (i in 1:10){
if (t == 1){
break }
t = t + 0.01
x[i] = t
}