Here is the code that I tried, to vary my iterations in a for loop
repscount <- value
for (i in 1:repscount) {
##certain calculations on x
if (x == 0) {repscount <- repscount + 1} else{}##add x to a list
}
But my repscount does not increase. Does is rewrite the value of repscount? Is there another way of doing this without using a while loop?