David Winsemius wrote:
I do not think your wetware processed the inputs correctly. The second bit should not have been flipped:

Ooops .. yes you are right!


Try this loop free index based solution:

 b <- c( 1, 0, 1, 0, 1, 0, 1, 0, 1, 0)
 r <- b
 r[p] <- 0 + !r[p]  # adding 0 converts logical TRUE/FALSE  to 0/1
 r
 [1] 0 0 0 0 0 0 0 0 1 0

Great! .. thanks ... I appreciate the hlep,


Esmail

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to