Hi I'm using a for loop in R to generate a series of numbers, calculate an estimate of interest based on these numbers each time and store all iterations of the estimate of interest in a vector. At times the estimate of interest would be NA depending on the numbers generated during that iteration. Is there a way to ask the for loop to re-run itself when the estimate of interest is NA?
Thanks!