[R] Logical vectors

Uwe Ligges ligges at statistik.uni-dortmund.de
Thu Jun 5 16:49:13 CEST 2003


Nolwenn Le Meur wrote:
> Hi everybody,
> 
> just a quick question that drives me crazy:
> Is it possible to "join" 2 logical vectors ?
> 
> i.e.
> x<-4
> ind <- 1:19200
> pin <- c(0, rep(400, 48) * (1:48))
> 
> ind1<-((pin[j] + 1) <= ind) & (ind <= pin[j + 2])
> ind2<-((pin[j+x] + 1) <= ind) & (ind <= pin[j+x + 2])
> 
> ind2 and ind1 give the right TRUE index
> 
> #but I would like something like that
> 
> ind3<-((pin[j] + 1) <= ind) & (ind <= pin[j + 2]) & ((pin[j+x] + 1) <= ind)
> & (ind <= pin[j+x + 2])
> 
> #but it doesn't work !

What does this mean ("doesn't work")?
I cannot reproduce your example since j is unknown.

Uwe Ligges




More information about the R-help mailing list