[Rd] && and ||
s.blomberg1 at uq.edu.au
Mon Apr 14 09:03:23 CEST 2008
Use the vector versions: & and |
On Sun, 2008-04-13 at 23:48 -0700, Yuan Jian wrote:
> 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
>  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
>  TRUE TRUE
> > f
>  FALSE TRUE
> > g<-e && f
> **g becomes one logical value only
> > g
>  FALSE
> what should I do when I want to get a sequence for operate && or ||?
> kind regards
> [[alternative HTML version deleted]]
> R-devel at r-project.org mailing list
Simon Blomberg, BSc (Hons), PhD, MAppStat.
Lecturer and Consultant Statistician
Faculty of Biological and Chemical Sciences
The University of Queensland
St. Lucia Queensland 4072
Room 320 Goddard Building (8)
T: +61 7 3365 2506
1. I will NOT analyse your data for you.
2. Your deadline is your problem.
The combination of some data and an aching desire for
an answer does not ensure that a reasonable answer can
be extracted from a given body of data. - John Tukey.
More information about the R-devel