Skip to content
Prev 301774 / 398503 Next

Alternating between "for loops"

Hello,

Maybe something along the lines of

J <- 10
cols <- rep(c(TRUE, TRUE, FALSE, FALSE), 3)[seq_len(J)]
for(i in which(cols)) { do something }
for(i in which(!cols)) { do something else }

Hope this helps,

Rui Barradas

Em 31-07-2012 00:18, Claudia Penaloza escreveu: