I just want to try to break a loop by having a condition that checks whether the last value of each of three vectors satisfies a particular condition that that may have taken place at that iteration OR past iterations of the loop.
Below is a very simple version of what I am trying to do.
Consider the following loop:
period = c(1:100)
x1 = 6
x2 = 8
x3 = 10
x = c()
for(t in 1:length(period)){x[t] = sample(c(x1,x2,x3), size = 1, replace = TRUE, prob = c(0.6,0.35,0.05))}
I am just wondering how I can make it such that this loop stops once each value has been sampled at least once. That is, the loop stops when each of x1,x2,x3 have been sampled.