[R] And Statement for two if functions

David Winsemius dwinsemius at comcast.net
Mon Jan 30 18:52:02 CET 2012


On Jan 30, 2012, at 9:52 AM, kerry1912 wrote:

> I want to perform two if functions at the same time:
>
> if(home team > away team & home team <= away team + 7) in R but i am
> struggling to work out how to write this correctly.

Generally newcomers to the R language find that the "ifelse" function  
does what they expect. The "if" function is quite different and seemes  
less likely to be what you wnat:

?Control
?ifelse


-- 
David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-help mailing list