[R] Logical vectors

Nolwenn Le Meur nolwenn.lemeur at nantes.inserm.fr
Thu Jun 5 15:47:35 CEST 2003


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 !

Help, thanks
Nolwenn

********************************************
Nolwenn Le Meur
INSERM U533
Faculté de médecine
1, rue Gaston Veil
44035 Nantes Cedex 1
France

Tel: (+33)-2-40-41-29-86 (office)
     (+33)-2-40-41-28-44 (secretary)
Fax: (+33)-2-40-41-29-50
mail: nolwenn.lemeur at nantes.inserm.fr




More information about the R-help mailing list