loop {oosp} | R Documentation |
The iter function produces an integer vector from min to n, if n >= min, and a zero length vector otherwise. Instead of if (n > 0) for (i in 1:n) ...commands..., we can write for (i in iter (n) ) ...commands... .
iter (n, min=1)
n |
|
min |