[R] Sub-vector

Wuming Gong wuming.gong at gmail.com
Wed Mar 29 19:20:58 CEST 2006


Dear list,

Given a vector of logical values, say

>a <- c(TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,TRUE,TRUE)

Are there any R functions that can tell whether there are two or more
"TRUE" in a row in this vector?

Thanks,

Wuming




More information about the R-help mailing list