I have a Program in R where i’m using do while loop in the following format
for(i in 1:n)
{
repeat
{
#code
if(condition){break}
}
}
I have a problem even if the condition in if statement is true the loop is been executed still.Can anyone help me with this
Thank you
Are you absolutely sure the condition is saying what you think it is?
And also, the break only takes you out of the “repeat” statement, you’ll still be inside the for-loop.