[R] One basic question - combining two conditions

Peter Dalgaard P.Dalgaard at biostat.ku.dk
Tue Nov 17 10:07:29 CET 2009


Julia Cains wrote:
> Dear R helpers
> 
> Suppose I want to use two conditions
> 
> if (x >= 42) and (x<48)
> 
> z = 45
> 
> else 
> 
> if (x>= 48) and (x<60)
> 
> z = 14
> 
> how do use this "and" operator to combine two conditions.
> 
> I am sorry as I know for many of you, this is very basic question but I am new to R and trying to learn it as early as possible.
> 
> Extremely sorry for this stupid question.

Have a look at help(Logic).



-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907




More information about the R-help mailing list