Use parentheses if you want to be sure, otherwise the help file for &  
and | says:

See Syntax for the precedence of these operators: unlike many other  
languages (including S) the AND and OR operators do not have the same  
precedence (the AND operators are higher than the OR operators).

hth, Ingmar

On 17 Jul 2007, at 08:59, Delphine Fontaine wrote:

> Dear R-users,
>
> I haven’t found rules for logical operators. I need to select data  
> according
> the following rule:
> Condition A & (Condition B | Condition C) How should I write it ? Is
> Condition A & Condition B | Condition C correct or will R execute  
> (Condition
> A & Condition B) | Condition C ?
>
> Thanks for your help.
>
> Delphine Fontaine
>
>
>
>
>
>
> Delphine Fontaine
> Statistician
> Statistics Department - Genexion SA
> ------------------------------------------------------------
> 29, Quai du Mont-Blanc
> Genva, CH-1201
> Switzerland
> ------------------------------------------------------------
> Office: +41 22 704 32 44
> Fax:    +41 22 704 32 42
> Email: [EMAIL PROTECTED]
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting- 
> guide.html
> and provide commented, minimal, self-contained, reproducible code.

Ingmar Visser
Department of Psychology, University of Amsterdam
Roetersstraat 15
1018 WB Amsterdam
The Netherlands
t: +31-20-5256735



        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to