From mathieu.ribatet at epfl.ch  Mon Apr 14 08:55:42 2008
From: mathieu.ribatet at epfl.ch (Mathieu Ribatet)
Date: Mon, 14 Apr 2008 08:55:42 +0200
Subject: [Rd] && and ||
In-Reply-To: <119453.25747.qm@web46003.mail.sp1.yahoo.com>
References: <119453.25747.qm@web46003.mail.sp1.yahoo.com>
Message-ID: <4802FFEE.60607@epfl.ch>

Well, you just have to use "&", "|" instead of "&&", "||".

Best,
Mathieu

Yuan Jian a ?crit :
> Hello there,
>    
>   I got a small problem about logical calculation:
>   we can get a sequene from a+b as below:
>    
>   > a<-c(1,2)
>   
>> b<-c(3,4)
>> a+b
>>     
> [1] 4 6
>    
>   but when the sequences are logical. (I want to get (True,False) && (True, True) ==> (True, False), but when I do as below.
>   
>> e<-c(T,T)
>> f<-c(F,T)
>> e
>>     
> [1] TRUE TRUE
>   
>> f
>>     
> [1] FALSE  TRUE
>   
>> g<-e && f
>>     
>   **g becomes one logical value only
>   
>> g
>>     
> [1] FALSE
>   
> what should I do when I want to get a sequence for operate && or ||?
>    
>   kind regards
>   Yu
>    
>
>         
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>   

-- 
Institute of Mathematics
Ecole Polytechnique F?d?rale de Lausanne
STAT-IMA-FSB-EPFL, Station 8
CH-1015 Lausanne   Switzerland
http://stat.epfl.ch/
Tel: + 41 (0)21 693 7907



[Rd] && and ||
Mathieu Ribatet