I got the below R codes which will generate total 3300 datasets and 6600 runs (k=2), these runs will run one by one (2~3 days). With the current code, when constraint condition, for example, 0 in dependent variable, is met in the if statement, this specific run(for example, tot = 1770) will break.
So my question is for a specific run, when that constraint condition is met, how can I regenerate the dataset (repeat the loop) until the newly generated dataset doesn't meet constraint condition to go through the rest of code.