This may not  be exactly what the OP wanted, but it may be easier
to plow the original vectors a and b thru something like

> alogic <-rle(!is.na(as.logical(a)))

which returns a bunch of lengths and strings of TRUEs and FALSEs .

Then play with alogic and blogic (created similarly to alogic), comparing to or multiplying them by a and b, and so on.

______________________________________________
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